ci: green PRs merge and deploy themselves - #1
Merged
Merged
Conversation
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.
Why
Merging and deploying should not need a human. The owner does not review PRs, and
background-job agent sessions are hard-barred from merging — so "the agent ships it"
cannot be a per-session promise. It has to be repo automation.
Same setup already running on orangecat and fleetcrown, ported with both bugs
their first live runs exposed already fixed.
The chain
push branch → open PR → CI green → auto-merge squash-merges → re-arm (ci.yml) → deployPolicy lives in
scripts/ci/auto-merge-sweep.sh. A PR merges iff it is not a draft,carries no hold label, has ≥1 check, every check finished green, and GitHub reports it
cleanly
MERGEABLE.How you hold work back
hold,no-automerge,do-not-merge,wip.Corollary: never open a non-draft PR you would not want deployed.
Adapted for this repo
workflow_dispatchtoci.yml— without it the re-arm below silently fails.Two load-bearing design points
it branched from, not against the other queued PRs — batch-merging would put a
combination on the base that nothing ever built.
GITHUB_TOKENdoes not triggerworkflows. CI and deploy here both run on
push, so without the explicit dispatch amerge would land and silently never build or ship. It is also what keeps the train
moving: the green-base guard requires a CI run for the current tip, so with no run
ever produced the next sweep would block forever.
Ported fixes (don't reintroduce)
moves, so the fast path always sees
UNKNOWNon its first look.cancel-in-progressmeans an unrelated push can kill aPR's build; nothing re-runs it and the PR strands forever. Genuine failures are left alone.
Bootstrap — this is the last hand-merge
GitHub only runs the default branch's copy of
workflow_run/scheduleworkflows, sothis PR cannot merge itself. One manual merge, ever; after it lands nothing here is merged
by hand again.
🤖 Generated with Claude Code