Skip to content

fix: use GITHUB_TOKEN for PR creation in tag-release#13

Merged
brayniac merged 1 commit intoiopsystems:mainfrom
brayniac:fix-tag-release-token
Apr 21, 2026
Merged

fix: use GITHUB_TOKEN for PR creation in tag-release#13
brayniac merged 1 commit intoiopsystems:mainfrom
brayniac:fix-tag-release-token

Conversation

@brayniac
Copy link
Copy Markdown
Contributor

Summary

The v2.0.0 release surfaced a token-permissions bug in tag-release.yml: the tag push and crates.io publish succeeded, but the automated dev-version bump PR failed to open:

pull request create failed: GraphQL: Resource not accessible by personal access token (createPullRequest)

Root cause

The workflow uses RELEASE_TOKEN (a PAT) for gh pr create so that pushes can trigger downstream workflows — PATs with contents: write do, but GITHUB_TOKEN doesn't. However, the job-level permissions: pull-requests: write only configures GITHUB_TOKEN; it has no effect on PATs. The RELEASE_TOKEN PAT was never granted pull_requests scope.

Fix

Use GITHUB_TOKEN (which has pull-requests: write from the job's permissions block) only for gh pr create. Keep RELEASE_TOKEN for all git pushes so tag and branch pushes continue to trigger their downstream workflows.

One-line env change plus a comment explaining the split.

Test plan

🤖 Generated with Claude Code

The RELEASE_TOKEN PAT has contents: write (so tag/branch pushes can
trigger downstream workflows) but lacks the pull_requests scope. The
job-level permissions block only configures GITHUB_TOKEN; it does not
grant scopes to PATs. Use GITHUB_TOKEN for gh pr create, keeping
RELEASE_TOKEN for pushes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@brayniac brayniac merged commit 7f98f51 into iopsystems:main Apr 21, 2026
7 checks passed
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