diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 21fac27ac..7ac7a0c10 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'