Skip to content

Commit

Permalink
fix: [030#72] Create github pr labels if they do not exist yet
Browse files Browse the repository at this point in the history
  • Loading branch information
sbp-bvanb committed Oct 31, 2024
1 parent 577eccc commit 26ef6fb
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
42 changes: 40 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,52 @@
name: python
'on': push
"on": push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: testing
run: |
check_label_exists() {
local label_name="$1"
LABEL_EXISTS=$(
gh label list --json name |
jq -r '
.[] |
select(.name == "'"$label_name"'") |
.name
'
)
if [ -z "$LABEL_EXISTS" ]; then
echo "label: '${label_name}' does NOT exist"
return 1
fi
}
dependenciesLabel=dependencies
if ! check_label_exists ${dependenciesLabel}; then
gh label create ${dependenciesLabel} \
--color "#0366d6" \
--description "Pull requests that update a dependency file"
fi
goLabel=go
if ! check_label_exists ${goLabel}; then
gh label create ${goLabel} \
--color "#16e2e2" \
--description "Pull requests that update Go code"
fi
goModUpdaterLabel=gomod-go-version-updater
if ! check_label_exists ${goModUpdaterLabel}; then
gh label create ${goModUpdaterLabel} \
--color "#F50BAB" \
--description "Pull requests that update Go version in the go.mod file"
fi
env:
GH_TOKEN: ${{ github.token }}
- uses: actions/[email protected]
with:
python-version: 3.9.18
cache: 'pip'
cache: "pip"
- name: Install PIP packages defined in requirements.txt
run: |
pip install -r requirements.txt
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vscode

0 comments on commit 26ef6fb

Please sign in to comment.