Self-hosted GitHub merge queue
Merge the commit you actually tested.
MergeSpan builds each candidate from the current base, runs your required checks on that exact SHA, then squash-merges one pull request at a time. No hosted queue subscription. One Worker or one Linux binary.
- AGPL-3.0-only
- Workers or Linux
- v0.1
A candidate, not a prediction.
Built from the current base plus the pull request head.
-
entry
Admit the PR queue
Non-draft, same repository, targeting
main. -
build
Build the candidate
mergespan/queue/42from the base tip and the PR head. -
verify
Check the exact SHA
Only a completed
successon the candidate commit counts — notneutralorskipped.ci / fast ci / integration -
merge
Re-read, then squash
Parent must be the pre-merge base and the tree must equal the candidate. A moved base rebuilds the candidate.
urgent jumps the line and interrupts the active candidate; the interrupted PR stays queued and is rebuilt later.
new push moves the head and removes the PR from the queue. Finish pushes, then add queue again.
Why it is narrow
Small on purpose.
MergeSpan v0.1 is not a general-purpose queue. The limits are the safety model, and they are documented before you install it.
| Constraint | v0.1 behavior | Why |
|---|---|---|
| Scope | One repository and one base branch | Queue state, configuration, and recovery stay per repository. |
| Merge method | Squash only | Linear history without merge-method branches or ambiguous tree checks. |
| PR source | Same-repository heads only | Fork pull requests are never queued or added to the candidate path. |
| Merge cadence | One candidate at a time — no batches | Every merge is tested against the base tip at that moment. |
| Entry and priority | Non-draft PR with queue; urgent interrupts |
Queueing is explicit; the interrupted PR stays queued and is rebuilt later. |
| Base compare-and-swap | Re-read, then verify parent and tree | GitHub has no atomic base CAS. A race pauses the queue instead of claiming success. |
From zero to queued
Five steps to the first pull request.
The full sequence lives in the quick start. These are the decisions it covers.
-
Self-host and install the App
Deploy the Worker or one static Linux binary, configure the documented App permissions and events, then install it on the single repository you will queue.
Self-hosting -
Sign in with write access
Enable console auth with the OAuth client ID and secret plus a session secret, then sign in with a GitHub account that has write access to the repository.
Console -
Commit config, CI, labels, and rulesets
Commit
Configuration.github/mergespan.tomlto the base, run required checks onpushtomergespan/queue/**, create thequeueandurgentlabels, and add the base ruleset (squash-only,mergespanrequired) plus the App-only candidate ruleset. -
Reconcile and confirm the config
Open the repository in the console and choose
ConsoleReconcile. Confirm setup reports the config loaded; a fresh installation needs no prior webhook delivery. -
Label a test pull request
Add
Quick startqueueto a non-draft same-repository pull request, then watch the pull request itself until it is squash-merged. Passing PR checks alone is not the finish line.