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
Queue candidate PR #42

A candidate, not a prediction.

Built from the current base plus the pull request head.

  1. Admit the PR queue

    Non-draft, same repository, targeting main.

    entry
  2. Build the candidate

    mergespan/queue/42 from the base tip and the PR head.

    build
  3. Check the exact SHA

    Only a completed success on the candidate commit counts — not neutral or skipped.

    ci / fast ci / integration
    verify
  4. Re-read, then squash

    Parent must be the pre-merge base and the tree must equal the candidate. A moved base rebuilds the candidate.

    merge

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.

MergeSpan v0.1 constraints and their reasons
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.

  1. 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
  2. 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
  3. Commit config, CI, labels, and rulesets

    Commit .github/mergespan.toml to the base, run required checks on push to mergespan/queue/**, create the queue and urgent labels, and add the base ruleset (squash-only, mergespan required) plus the App-only candidate ruleset.

    Configuration
  4. Reconcile and confirm the config

    Open the repository in the console and choose Reconcile. Confirm setup reports the config loaded; a fresh installation needs no prior webhook delivery.

    Console
  5. Label a test pull request

    Add queue to 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.

    Quick start