fix(ci): grant validate job contents:write to see draft releases#518
Merged
c-vigo merged 1 commit intorelease/0.3.3from Apr 10, 2026
Merged
Conversation
The GitHub API only returns draft releases to tokens with push access. The validate job had contents:read, so the draft release check always failed. Elevate to contents:write and use github.token for the workspace template variant (upstream already used github.token). TDD skipped: CI workflow YAML — only verifiable via GitHub Actions run. Refs: #517
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.
Description
The Promote Release workflow always fails at the "Verify draft GitHub Release exists" step in the
validatejob. The GitHub API only returns draft releases to tokens with push access (contents: write), but thevalidatejob hadcontents: readand the workspace template variant was using the release app token which also lacked push-level permissions.This PR elevates the
validatejob permissions tocontents: writein both the upstream and workspacepromote-release.yml, and switches the workspace template's draft release check to usegithub.token(the upstream already used it).Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
.github/workflows/promote-release.yml— changevalidatejobcontents: readtocontents: writeassets/workspace/.github/workflows/promote-release.yml— changevalidatejobcontents: readtocontents: write; switchGH_TOKENin the draft release check step from the release app token to${{ github.token }}CHANGELOG.md— add Fixed entry for [BUG] Promote Release workflow fails — GITHUB_TOKEN cannot see draft releases #517assets/workspace/.devcontainer/CHANGELOG.md— synced by pre-commit hookChangelog Entry
Fixed
validatejob permissions tocontents: writeso the token has push-level access required by the GitHub API to list draft releasesgithub.tokeninstead of the release app token for the draft release check in workspacepromote-release.ymlTesting
just test)Manual Testing Details
TDD skipped: CI workflow YAML changes can only be verified by running the actual GitHub Actions pipeline. Verification will occur when the Promote Release workflow is re-run for 0.3.3.
Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
This fix affects both the upstream and workspace template
promote-release.yml. The upstream workflow already used${{ github.token }}for the draft release check but still hadcontents: read, so only the permission needed changing. The workspace template also needed the token source switched from the release app token to${{ github.token }}.Refs: #517