ci(labels): create unforced labels only when they are missing
gh label create exits non-zero for a label that already exists, and the step runs with bash -e, so the first existing unforced label stopped the job. Skip labels that already exist, keeping hand-set colors. Fixes #2320 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d70b899894
commit
1a2ca5678d
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Reference in New Issue