fix(release): use a one-shot PR instead of pushing the bump to main directly#10
Merged
JohnnyVicious merged 1 commit intomainfrom Apr 12, 2026
Merged
fix(release): use a one-shot PR instead of pushing the bump to main directly#10JohnnyVicious merged 1 commit intomainfrom
JohnnyVicious merged 1 commit intomainfrom
Conversation
…irectly
Release run 24308400583 failed because the previous workflow tried to
`git push origin HEAD:main` and was rejected by the branch protection
rule "Changes must be made through a pull request" (GH013):
remote: error: GH013: Repository rule violations found for refs/heads/main.
remote: - Changes must be made through a pull request.
The bump commit and tag never reached origin (the worker's filesystem
is gone), so there's nothing to clean up.
This change replaces the direct-push step with a PR-mediated flow that
satisfies the branch protection rule:
1. `Push the bump on a release branch` — checkout `release/v${version}`,
commit the bumped manifests, push the branch.
2. `Open the release PR and merge it` — `gh pr create` against main with
a descriptive title/body, then `gh pr merge --squash --delete-branch`.
The change reaches main *through* a PR, which is what the rule wants,
while the workflow remains fully automated.
3. `Tag the merged commit on main` — fetch + reset --hard origin/main to
pick up the squash-merge commit, tag it, push the tag.
4. `Create GitHub release` — unchanged, still uses
`gh release create --generate-notes`.
Permissions: added `pull-requests: write` so the workflow can open and
merge the release PR. `contents: write` is still needed for the tag push.
Header comment updated to document the new flow.
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
Release run 24308400583 failed because the previous workflow tried to `git push origin HEAD:main` and was rejected by the branch protection rule:
```
remote: error: GH013: Repository rule violations found for refs/heads/main.
remote: - Changes must be made through a pull request.
```
The bump commit and tag never reached origin (the worker's filesystem is gone), so there is nothing to clean up — `origin/main` is still at `f19fbf0` and no `v1.0.1` tag exists.
Fix
Replace the single "commit, tag, and push" step with a PR-mediated flow that satisfies the branch protection rule:
Permissions
Added `pull-requests: write` so the workflow can open and merge the release PR. `contents: write` is still needed for the tag push.
Test plan
Alternative considered
I considered configuring the branch protection ruleset to add `github-actions[bot]` as a bypass actor instead, which would let the original direct-push flow work as-is. I went with the PR-based flow because it doesn't depend on hidden repo configuration the user has to remember, and it leaves a paper trail in the PR list for every release. Happy to switch if you'd rather have the simpler workflow + bypass list.