Skip to content

fix(auto-merge-release): use --admin to bypass base branch policy on merge - #89

Merged
sebastiancorrea81 merged 1 commit into
mainfrom
fix/auto-merge-release-admin-bypass
Aug 7, 2026
Merged

fix(auto-merge-release): use --admin to bypass base branch policy on merge#89
sebastiancorrea81 merged 1 commit into
mainfrom
fix/auto-merge-release-admin-bypass

Conversation

@sebastiancorrea81

Copy link
Copy Markdown
Collaborator

Problem

Live-tested against nullplatform/tofu-modules PR #476 (a real release-please PR): find-pr resolved it, checks were confirmed green, but the final gh pr merge failed with:

X Pull request nullplatform/tofu-modules#476 is not mergeable: the base branch policy prohibits the merge.

The App token isn't actually being treated as a bypass actor on the caller repo's branch ruleset (tofu-modules' main ruleset requires 1 approving review). Every release PR merged historically was done by a human — this may have always been broken, just never reached because of an earlier trigger bug (see nullplatform/tofu-modules#479, #481).

Fix

Add --admin to the merge command. This only succeeds if the App's installation has "Administration: write" permission on the target repo — if it doesn't, the merge will fail with a clearer, permission-specific error instead of the generic policy one, which tells us definitively what to fix next (grant that permission) rather than leaving us guessing.

Test plan

  • Merge this PR.
  • Re-run the failed auto-merge-release-pr run on nullplatform/tofu-modules (or wait for the next one) and confirm the merge step either succeeds, or fails with a specific permission error we can act on.

🤖 Generated with Claude Code

…merge

The final `gh pr merge` step fails with "the base branch policy prohibits
the merge" even after all other checks pass — the App token isn't actually
treated as a bypass actor on the caller repo's branch ruleset (observed
live on nullplatform/tofu-modules PR #476, required-review rule). Add
--admin so the merge goes through if the App's installation has
Administration permission; if it doesn't, this fails with a clearer
permission-specific error instead of the generic policy one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sebastiancorrea81
sebastiancorrea81 merged commit 4678465 into main Aug 7, 2026
2 checks passed
@sebastiancorrea81
sebastiancorrea81 deleted the fix/auto-merge-release-admin-bypass branch August 7, 2026 17:51
sebastiancorrea81 added a commit to nullplatform/tofu-modules that referenced this pull request Aug 7, 2026
Small, low-risk change used as a real trigger to test the full
post-merge automation chain (#479, #481,
nullplatform/actions-nullplatform#89) end-to-end on a clean cycle: this
PR's merge → release-please PR → auto-merge (workflow_run + REST author
check + --admin) → tag/release, with no manual step in between.

Root README's usage example pinned `infrastructure/aws/vpc` to
`v1.56.1`, several major versions behind the current `v6.10.0` — updated
so copy-pasting the example doesn't point at a stale tag.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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