From 1a2ca5678d9a9f63cc490da6638133f3f10a08fa Mon Sep 17 00:00:00 2001 From: Aerovity Date: Fri, 9 Oct 2026 18:12:45 +0200 Subject: [PATCH] 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 --- .github/workflows/labels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 3429cb6ff..a0f142cfa 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -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'