fix(ci): merge via REST when gh's client-side precheck refuses - #286
Merged
Conversation
Diagnosis, now with the number that was missing before: the sweep logs its own
view at the merge site, and it reads
#278 direct merge refused (MERGEABLE/BLOCKED)
#282 direct merge refused (MERGEABLE/BLOCKED)
while a PAT reads MERGEABLE/CLEAN for the same two PRs at the same moment.
mergeStateStatus is computed per viewer, and `gh pr merge` refuses client-side
on BLOCKED. `--auto` goes through the identical precheck, so it was refused
too — that fallback never fired.
main has branch protection with every option disabled, no rulesets, no
CODEOWNERS, no required checks and no required reviews, so there is no rule
being enforced here. Meanwhile #224, #225 and #226 — all of which modify
.github/workflows/ — merged normally, so this is not the workflows scope.
The REST merge endpoint skips the precheck and enforces the branch's actual
protection instead. If GitHub does refuse, it returns non-2xx and the PR is
left for the next sweep exactly as before; nothing is forced past a real rule.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
The measurement that was missing
#283 added the sweep's own view to the merge line. It reads:
A PAT reads
MERGEABLE/**CLEAN**for those same two PRs at the same moment.mergeStateStatusis computed per viewer, andgh pr mergerefuses client-side whenever it seesBLOCKED.--auto(added in #283) goes through the same precheck — so it was refused too and never actually fired. That fallback was the wrong lever.There is no rule being enforced
main: exists, every option disabledworkflowsscope: ci: bump actions/upload-artifact from 4 to 7 #224, ci: bump actions/setup-node from 4 to 7 #225, ci: bump actions/checkout from 4 to 7 #226 all modify.github/workflows/and merged normally todayThe fix
The REST merge endpoint has no client-side precheck and enforces the branch's actual protection. If GitHub genuinely refuses, it returns non-2xx and the PR is left for the next sweep — unchanged behaviour, nothing forced past a real rule.
Unblocks #278 and #282, which have been green and unmergeable through six sweeps.
🤖 Generated with Claude Code