fix(merge): surface real --admin error on review-blocked PRs#319
Merged
Conversation
When a PR is review-blocked (REVIEW_REQUIRED/CHANGES_REQUESTED), do_merge tried `--admin` then `--auto`, but the auto-merge tier overwrote LAST_GH_ERR before the exit-4 die — so the admin tier's real failure was swallowed and only the (often misleading) auto-merge error surfaced. With auto-merge disabled, this made /merge report "no admin" even when the operator held repo admin and the true cause was a pending required status check. - Capture the admin tier's stderr into a local before the auto-merge tier runs, log it (`Admin merge failed: …`), and include both the admin and auto-merge errors in the exit-4 message. - Reword exit-4 (script + SKILL.md) to stop asserting "no admin"; point at a pending required status check as the likely cause (gh refuses an admin merge until required checks resolve) and branch guidance on the real error. Squash worktree auto-switch is unaffected — MERGE_METHOD_BASE still set on every success path (verified). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
8a354d4 to
b9c2a34
Compare
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.
do_merge captured only the auto-merge tier's error on review-blocked PRs, swallowing the real --admin failure and misreporting "no admin". Surface the actual admin error and reword exit-4 to point at pending required checks.
Co-Authored-By: Claude noreply@anthropic.com