Skip to content

Create the release PR with the built-in token instead of a PAT - #363

Merged
abhijeetnarvekar merged 1 commit into
mainfrom
release-without-pat
Dec 2, 2026
Merged

abhijeetnarvekar merged 1 commit into
mainfrom
release-without-pat

Conversation

@abhijeetnarvekar

Copy link
Copy Markdown
Contributor

Summary

The Release Stable workflow used secrets.PAT for one thing: opening the "Release X" PR and enabling auto-merge. The PAT (from 2024-06) had expired, so the 1.1.3 release failed at "Create GitHub PR" with HTTP 401, and the PR (#362) and draft release had to be created by hand.

This switches that step to the built-in github.token, so there is no personal token to keep alive.

Why it isn't just a token swap

main requires the Build status check. Pushes and PRs made with the built-in token don't trigger workflows, so Build would never run on the release branch and auto-merge would wait forever. workflow_dispatch is the exception, so the step now runs gh workflow run build.yml --ref "$PR_BRANCH_NAME" (build.yml already has workflow_dispatch). The dispatched run reports Build on the branch's head commit, which satisfies the required check. That needs actions: write, added to the workflow's permissions.

Repo settings already allow the rest: "Allow GitHub Actions to create and approve pull requests" is on, and auto-merge with rebase is enabled.

Behaviour changes

  • The release PR is now authored by github-actions[bot]. You can approve it yourself, which you couldn't do while the PR was authored by the PAT's owner.
  • When auto-merge lands the PR, the push to main comes from the built-in token, so the push Build on main won't run for that merge commit. The nightly scheduled Build still covers main.

Testing

  • actionlint (v1.7.12) reports no new findings; the only output is shellcheck quoting notes that main already has.
  • This can only be exercised end-to-end by the next stable release.

After merging

Delete the PAT repository secret; nothing else uses it (grep over .github/workflows).

🤖 Generated with Claude Code

The Release Stable workflow used secrets.PAT only to open and auto-merge
the release PR. The PAT expired, which failed the 1.1.3 release at that
step. Use github.token instead, and dispatch the Build workflow on the
release branch: pushes and PRs made with the built-in token don't
trigger workflows, but workflow_dispatch does, and main requires the
Build check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@abhijeetnarvekar abhijeetnarvekar self-assigned this Dec 2, 2026
@abhijeetnarvekar
abhijeetnarvekar merged commit df58faa into main Dec 2, 2026
12 checks passed
@abhijeetnarvekar
abhijeetnarvekar deleted the release-without-pat branch December 2, 2026 10:41
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.

2 participants