Merge pull request #2360 from Aerovity/ci/labels-skip-existing

ci(labels): create unforced labels only when they are missing
This commit is contained in:
Dean 2026-10-10 11:39:22 +13:00 committed by GitHub
commit 3e3290dc03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -19,7 +19,8 @@ jobs:
GH_REPO: ${{ github.repository }}
steps:
- run: |
label() { gh label create "$1" --color "$2" --description "$3"; }
existing=$(gh label list --limit 1000 --json name --jq '.[].name')
label() { grep -qixF -- "$1" <<< "$existing" || gh label create "$1" --color "$2" --description "$3"; }
force_label() { gh label create "$1" --color "$2" --description "$3" --force; }
force_label 'needs rebase' b60205 'Conflicts with main, rebase needed'