Skip to content

fix(ci): merge via REST when gh's client-side precheck refuses - #286

Merged
github-actions[bot] merged 1 commit into
mainfrom
ci/rest-merge-fallback
Aug 7, 2026
Merged

fix(ci): merge via REST when gh's client-side precheck refuses#286
github-actions[bot] merged 1 commit into
mainfrom
ci/rest-merge-fallback

Conversation

@catomean

@catomean catomean commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

The measurement that was missing

#283 added the sweep's own view to the merge line. It reads:

[auto-merge] #278 direct merge refused (MERGEABLE/BLOCKED) — ...
[auto-merge] #282 direct merge refused (MERGEABLE/BLOCKED) — ...

A PAT reads MERGEABLE/**CLEAN** for those same two PRs at the same moment. mergeStateStatus is computed per viewer, and gh pr merge refuses client-side whenever it sees BLOCKED.

--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

The 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

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>
@github-actions
github-actions Bot merged commit bd3a1c4 into main Aug 7, 2026
8 checks passed
@github-actions
github-actions Bot deleted the ci/rest-merge-fallback branch August 7, 2026 11:04
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