Skip to content

fix(ci): bypass branch protection in release workflow#121

Merged
mdanish98 merged 1 commit into
mainfrom
fix-release-workflow-branch-protection
Jun 10, 2026
Merged

fix(ci): bypass branch protection in release workflow#121
mdanish98 merged 1 commit into
mainfrom
fix-release-workflow-branch-protection

Conversation

@ricogu

@ricogu ricogu commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

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* — the all-tests-passed status check is required by the default-branch-protection ruleset, but a freshly-created release branch in CI has no prior check runs, so the push was always rejected.

Changes Made

  • Removed git checkout -b "release/v$VERSION" — no release branch is created or pushed
  • The @main@v{major} substitution in action.yml files still happens (required so consumers pinning to a tag get pinned sub-action references, not floating @main)
  • The substitution commit is created as a detached commit using git write-tree + git commit-tree, which is not on any branch and therefore not subject to branch protection rules
  • Tags are pushed directly; refs/tags/* are not covered by the ruleset
  • Removed unused pull-requests: write and statuses: write permissions (no longer needed)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Root Cause

The default-branch-protection ruleset applies to:

  • ~DEFAULT_BRANCH
  • refs/heads/release/*
  • refs/heads/main

It requires a PR with 1 approval + the all-tests-passed status check before any push. The release workflow was pushing directly to release/v*, which matches refs/heads/release/*, and that push was rejected every time.

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 mdanish98 merged commit 8f7c5af into main Jun 10, 2026
15 checks passed
@mdanish98 mdanish98 deleted the fix-release-workflow-branch-protection branch June 10, 2026 09:45
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