-
Notifications
You must be signed in to change notification settings - Fork 128
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug
The Pre-Release Companion workflow (prerelease.yml) fails on first-time PR creation because gh pr create --label "autorelease: prerelease" requires the label to already exist in the repository. If it doesn't, the step fails with:
could not add label: 'autorelease: prerelease' not found
Error: Process completed with exit code 1.
Root Cause
The gh pr create CLI command does not auto-create labels — it expects them to already exist. The workflow has no step to ensure the label exists before using it.
Additionally, the gh pr edit path (for updating an existing PR) never applies the label at all, so if the PR was created before the label existed, or the label was removed, it won't be re-applied on subsequent updates.
Fix
- Add an "Ensure pre-release label exists" step before the PR create/update step that idempotently creates the label using
gh label create ... 2>/dev/null || true. - Add
--add-label "autorelease: prerelease"to thegh pr editpath so the label is consistently applied on updates too.
Related
No other workflows use --label with gh CLI commands, so this is the only instance of this pattern in the repository.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working