Skip to content

fix(ci): fall back to native auto-merge when a direct merge is refused - #283

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

fix(ci): fall back to native auto-merge when a direct merge is refused#283
github-actions[bot] merged 1 commit into
mainfrom
ci/merge-blocked-fallback

Conversation

@catomean

@catomean catomean commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Symptom

Three consecutive sweeps read #278 and #282 as MERGEABLE/CLEAN, announced the merge, and were refused:

X Pull request maonakamoto/evig#278 is not mergeable: the base branch policy prohibits the merge.

Both PRs sat green and unmergeable while the queue drained around them.

There is no such policy

Checked, all of it:

branch protection on main exists, every option disabled
required status checks none
required reviews / reviewDecision none / empty
rulesets none
CODEOWNERS absent
squash merge allowed yes

And it is not the token's workflows scope — the same bot merged #225 and #226 today, both of which modify .github/workflows/:

4de6cbf25 (#226)  .github/workflows/{auto-merge,ci,main-red-alert}.yml
dde3e8f50 (#225)  .github/workflows/{ci,deploy-selfhost,prod-protocols-smoke}.yml

What it actually is

gh pr merge refuses client-side based on the mergeStateStatus that GITHUB_TOKEN sees, which is not always the one a PAT sees. The script cannot inspect its way out of a disagreement it is on the wrong side of.

So: log what we saw (mergeable/mergeStateStatus now appear on the merge line), then delegate to native auto-merge — GitHub performing the merge itself, which does not go through that precheck. It is the escape hatch gh names in its own failure message.

Discipline preserved

The fallback is followed by the same break, so at most one PR per sweep is ever handed over, and the green-base guard is untouched.

🤖 Generated with Claude Code

Three consecutive sweeps read #278 and #282 as MERGEABLE/CLEAN, announced the
merge, and were refused:

    X Pull request #278 is not mergeable:
      the base branch policy prohibits the merge.

There is no such policy. main has branch protection with every option
disabled, no rulesets, no CODEOWNERS, no required checks and no required
reviews. Throughout the same window the bot merged #225, #226, #279 and #280
without trouble — including #225/#226, which modify .github/workflows/, so
this is not the token's workflows scope either.

The refusal is gh's client-side precheck reading the mergeStateStatus that
GITHUB_TOKEN sees, which is not the one a PAT sees — nothing this script can
inspect its way around. So log both what we saw and delegate: native
auto-merge is GitHub performing the merge itself, and does not go through that
precheck. It is the escape hatch gh names in its own error message.

Still one car per sweep — the fallback is followed by the same `break`, so at
most one PR per sweep is handed over, and the green-base guard is unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions
github-actions Bot merged commit bb43b5b into main Aug 7, 2026
8 checks passed
@github-actions
github-actions Bot deleted the ci/merge-blocked-fallback branch August 7, 2026 10:26
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