[SPN-2931] Pre-create repo labels in workflow (fixes 'quality-issues' not found)#27
Merged
Merged
Conversation
The last sdk-update run failed at the PR-create step: 'quality-issues' not found Root cause: `gh pr edit --add-label "a,b,c"` validates every label name in its CSV against the repo's registered labels and fails the entire call if any one is missing. We introduced the `quality-issues` name in the previous PR (#26) but never created the matching label in the repo, so the first run after merge died here. Fix: add an "Ensure workflow labels exist" step that runs `gh label create --force` for each label name the workflow knows about. --force makes it idempotent (creates if missing, updates color/description if present, exits 0 either way). Same step covers auto-generated, breaking, generation-failed, and quality-issues so future additions are self-healing — code change is enough, no manual repo setup required. Also adds `issues: write` to the job's permissions block, since `gh label create` hits the labels API which lives under issues, not pull-requests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
anderslyman
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hotfix for #26. The first sdk-update run after merge died at the PR-create step:
```
'quality-issues' not found
```
`gh pr edit --add-label "a,b,c"` validates every label in its CSV against the repo's registered labels and fails the whole call if any one is missing. The `quality-issues` name was introduced in #26 but never created in the repo UI.
Fix
Add an idempotent "Ensure workflow labels exist" step before the PR-create step. Runs `gh label create --force` for each label name the workflow knows about (`auto-generated`, `breaking`, `generation-failed`, `quality-issues`).
`--force` makes it self-healing — creates if missing, updates color/description if present. Future label additions only need a code change here; no manual repo setup.
Also adds `issues: write` to the job's permissions (the labels API lives under issues, not pull-requests).
Test plan
🤖 Generated with Claude Code