forked from 030/gomod-go-version-updater-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: [030#72] Create github pr labels if they do not exist yet
- Loading branch information
Showing
2 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.vscode |