Skip to content

Harden release tag push (retry + workflows permission) - #12

Merged
JerrettDavis merged 2 commits into
mainfrom
chore/harden-release-tag-push
Jul 22, 2026
Merged

Harden release tag push (retry + workflows permission)#12
JerrettDavis merged 2 commits into
mainfrom
chore/harden-release-tag-push

Conversation

@JerrettDavis

@JerrettDavis JerrettDavis commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

The release job's "Create and push git tag" step intermittently fails with:

refusing to allow a GitHub App to create or update workflow ... without workflows permission

This is preventive hardening for that failure mode.

Changes

  • Retry loop: wrapped 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: write permission — attempted then reverted. I initially added workflows: write to the release job's permissions: block as requested. However, workflows is not a valid GITHUB_TOKEN permission scope in GitHub Actions workflow YAML (confirmed against GitHub's workflow syntax reference — valid keys are actions, attestations, checks, contents, deployments, discussions, id-token, issues, packages, pages, pull-requests, security-events, statuses, etc.; no workflows). 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 on main too. I reverted that line in a follow-up commit. Note also that GITHUB_TOKEN can never be granted write access to .github/workflows/* files via the permissions: block regardless of scope name — this is a hard platform restriction — and a plain git tag && git push doesn'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-checks job (build/test/pack) should run and pass on this PR as usual
  • release job is expected to NOT run on this PR (it only triggers on push to main) — will only be exercised on merge to main
  • Confirm no regressions once merged and a real release runs

🤖 Generated with Claude Code

JerrettDavis and others added 2 commits July 22, 2026 12:55
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant