Harden release tag push (retry + workflows permission) - #12
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GITHUB_TOKEN permissions in workflow YAML do not support a "workflows" scope (valid keys: actions, contents, packages, pull-requests, security-events, etc. - see GitHub's workflow syntax reference). Adding it invalidated the whole workflow file, causing every job (including pr-checks) to fail to schedule. The GITHUB_TOKEN can never be granted write access to .github/workflows/* files regardless of permissions configured here, so this scope cannot fix the reported error; the retry loop on the tag push remains as the effective hardening for transient push failures. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Jul 27, 2026
Closed
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
The
releasejob's "Create and push git tag" step intermittently fails with:This is preventive hardening for that failure mode.
Changes
git push origin "v${PACKAGE_VERSION}"in a minimal retry loop (3 attempts, 5/10/15s backoff) so transient push failures don't fail the whole release job.workflows: writepermission — attempted then reverted. I initially addedworkflows: writeto thereleasejob'spermissions:block as requested. However,workflowsis not a valid GITHUB_TOKEN permission scope in GitHub Actions workflow YAML (confirmed against GitHub's workflow syntax reference — valid keys areactions,attestations,checks,contents,deployments,discussions,id-token,issues,packages,pages,pull-requests,security-events,statuses, etc.; noworkflows). Adding it made the entire workflow file schema-invalid: the push-triggered run failed immediately with 0 jobs scheduled (visible as run 29944443835), which would have broken CI onmaintoo. I reverted that line in a follow-up commit. Note also thatGITHUB_TOKENcan never be granted write access to.github/workflows/*files via thepermissions:block regardless of scope name — this is a hard platform restriction — and a plaingit tag && git pushdoesn't touch workflow files anyway, so the retry loop is the effective fix here; the original error is most plausibly a transient GitHub API hiccup that a retry absorbs.No other steps, jobs, or behavior were changed.
Test plan
pr-checksjob (build/test/pack) should run and pass on this PR as usualreleasejob is expected to NOT run on this PR (it only triggers onpushtomain) — will only be exercised on merge to main🤖 Generated with Claude Code