fix(ci): bypass branch protection in release workflow#121
Merged
Conversation
The release workflow was pushing a release/v* branch which is covered by the default-branch-protection ruleset requiring all-tests-passed. Since the branch is created fresh in CI with no prior check runs, the push was always rejected. Fix: remove the release branch entirely. The @main -> @v{major} substitution commit is created as a detached commit (via git write-tree + git commit-tree) that is not on any branch, so it bypasses branch protection rules. Only tags are pushed, which are not subject to the ruleset.
mdanish98
approved these changes
Jun 10, 2026
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
Fixes the release workflow that was failing at the "Tag and Push" step with
GH013: Repository rule violations found for refs/heads/release/v*— theall-tests-passedstatus check is required by thedefault-branch-protectionruleset, but a freshly-created release branch in CI has no prior check runs, so the push was always rejected.Changes Made
git checkout -b "release/v$VERSION"— no release branch is created or pushed@main→@v{major}substitution inaction.ymlfiles still happens (required so consumers pinning to a tag get pinned sub-action references, not floating@main)git write-tree+git commit-tree, which is not on any branch and therefore not subject to branch protection rulesrefs/tags/*are not covered by the rulesetpull-requests: writeandstatuses: writepermissions (no longer needed)Type of Change
Root Cause
The
default-branch-protectionruleset applies to:~DEFAULT_BRANCHrefs/heads/release/*refs/heads/mainIt requires a PR with 1 approval + the
all-tests-passedstatus check before any push. The release workflow was pushing directly torelease/v*, which matchesrefs/heads/release/*, and that push was rejected every time.