fix(release): pre-create the tag via refs API so GITHUB_TOKEN can publish - #478
Merged
Merged
Conversation
githubrobbi
enabled auto-merge
June 26, 2026 13:57
…lish The v0.6.14 release (run #135) failed: action-gh-release's `POST /releases` with a commit-SHA `target_commitish` now returns 403 "Resource not accessible by integration" under the GITHUB_TOKEN integration (cli/cli#9514; began ~2026-06, PATs unaffected — which is why the bot fails but a user token succeeds). All three binaries built fine; only the publish step 403'd. Fix without introducing a PAT (no secret to mint, rotate, or leak; keeps the least-privilege auto-scoped GITHUB_TOKEN): create the tag ref ourselves at the exact built commit via `POST /git/refs`, then have action-gh-release attach the release to the now-existing tag with NO `target_commitish`. That threads both server-side guards — the refs API is not subject to the workflow-file push guard that rejects `git push origin $TAG` (run A GITHUB_TOKEN-created tag also does not re-trigger this `push: tags: v*` workflow, so there is no double-release. Build-commit pinning is preserved because we tag `inputs.commit_sha` directly. Idempotent on re-runs (skips when the tag already exists). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
githubrobbi
force-pushed
the
ci/release-tag-precreate-no-target
branch
from
June 26, 2026 14:02
2f7bea3 to
d511012
Compare
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.
Problem
The v0.6.14 release (run #135) failed at the publish step:
All three binaries built fine — only
action-gh-release'sPOST /releases403'd. Root cause (confirmed via cli/cli#9514): creating a release with a commit-SHAtarget_commitishunder theGITHUB_TOKENintegration now returns "Resource not accessible by integration" (began ~2026-06; PATs are unaffected, which is exactly why the bot fails but a user token succeeds). Repo/org settings, workflow permissions (token hadContents: write), and rulesets were all verified permissive — it's the API endpoint, not config.Fix (no PAT — eliminates the failure mode, doesn't defer it)
Split tag creation from release creation:
POST /git/refs— not subject to the workflow-file push guard that rejectsgit push origin $TAG(run #24795626228), and a plaincontents:writeop rather than the release-with-target endpoint that 403s.action-gh-releaseattaches the release to the now-existing tag with notarget_commitish→ sidesteps the cli#9514 403.Why this over a PAT:
GITHUB_TOKEN.push: tags: v*workflow (a PAT-pushed tag would).inputs.commit_shadirectly.After merge
Re-dispatch
release.ymlfor v0.6.14 (workflow_dispatch, commitce5abac) to publish the full 45-asset release via the real pipeline.