From 248b2de881d48c43d2563d4aabe19b50a85b51b5 Mon Sep 17 00:00:00 2001 From: abhinav <244986440+erensh27@users.noreply.github.com> Date: Sun, 9 Aug 2026 13:13:07 +0530 Subject: [PATCH] fix(ci): never fail issue labeler on unknown labels The labeler LLM is told to pick from a fixed set of labels, but several of those labels do not exist in the repo (e.g. 'compile', 'attention-backends', 'torchao', 'new-pipeline/model'). Applying any of them with 'gh issue edit --add-label' fails the whole job, so most bug reports end up with no labels at all (issue #14377: 'needs-env-info'). Filter the model output against the repo's actual label list before applying, and emit a warning for any label that does not exist instead of failing the run. --- .github/workflows/issue_labeler.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/issue_labeler.yml b/.github/workflows/issue_labeler.yml index 30acf9193df0..ced0f81ae127 100644 --- a/.github/workflows/issue_labeler.yml +++ b/.github/workflows/issue_labeler.yml @@ -31,6 +31,11 @@ jobs: ISSUE_NUMBER: ${{ github.event.issue.number }} LABELS: ${{ steps.get-labels.outputs.labels }} run: | + existing=$(gh label list --limit 100 --json name | python -c "import json,sys; print('\n'.join(l['name'] for l in json.load(sys.stdin)))") for label in $(echo "$LABELS" | python -c "import json,sys; print('\n'.join(json.load(sys.stdin)))"); do - gh issue edit "$ISSUE_NUMBER" --add-label "$label" + if echo "$existing" | grep -Fqx "$label"; then + gh issue edit "$ISSUE_NUMBER" --add-label "$label" + else + echo "::warning::Issue labeler produced '$label', which does not exist in this repo; skipping." + fi done