v0.5.2Early days: do not use it in production yet →

Never break main again.

CIHub is the self-hosted merge queue for GitHub. It tests each pull request on top of everything that lands before it, and merges it only if the result still passes. With the CI you already have.

Install CIHubRead the docs$helm install cihub oci://ghcr.io/getcihub/charts/cihub
Open sourceOne container and a PostgresYour code stays on your infrastructure
CIHub never runs your CI. It waits for the checks you already have:
GitHub ActionsBuildkiteCircleCIJenkinsand any CI that reports a check
// the problem

Two green pull requests. One red main.

Two pull requests pass CI on their own. You merge both. main is red, and nobody knows why: each one was tested without the other.

Without a merge queue

main is red

Each pull request was green on an old main. Nobody tested the two together before they landed.

With CIHub

main stays green

CIHub tests the exact commit that will land: main, the pull requests ahead, and this one. If it fails, nothing lands.

// how it works

Approve, type one command, go back to work.

No rebase loop, no broken main, no "who merged that?". You do not create a queue: the first command creates it.

01

Approve

A pull request is approved and its checks are green.

02

Queue

Comment /cihub merge. CIHub tests it on top of everything ahead of it, alone or in a batch.

03

Merge

If that exact combination passes, CIHub merges it. If not, the pull request leaves the queue, with the reason on it.

// why CIHub

A merge queue that you run, and that explains itself.

Green by design

What gets tested is exactly what lands. The required checks are read on the target branch, never from the pull request, so that a pull request cannot weaken its own gate.

Your CI, unchanged

CIHub pushes a test branch and waits for the required statuses and check runs. If it reports a check, CIHub waits for it.

GitHub ActionsBuildkiteCircleCIJenkins

Yours to run

One container and a Postgres. Your code stays on your infrastructure. One instance serves several GitHub organizations.

Never a mystery

Each pull request says where it stands in the queue and what it waits for: on GitHub, in the dashboard, in the CLI.

Quick when it gets busy

Pull requests are tested in parallel or in batches. A failed batch is split to find the cause, and one flaky failure does not kick anyone out.

// configuration

A queue works without a file.

To change its behavior, add .cihub.yaml at the root of the repository. CIHub reads it on the head of the target branch, never from a pull request.

  • sequential, pipelined or batched: one test at a time, tests in parallel, or several pull requests per test.
  • Conditions to enter the queue and to merge: labels, reviews, checks, files, authors.
  • Priority rules: an urgent fix goes first, dependency updates go last.
  • A JSON Schema, so that your editor completes and checks each key.
.cihub.yaml
1# yaml-language-server: $schema=https://cihub.io/schema/config/v1.json
2version: 1
3queues:
4  - branch: main
5    strategy: batched
6    batching:
7      size: 3
8      max_wait_minutes: 1
9    queue_conditions:
10      draft: false
11      labels:
12        none: [do-not-merge]
13      checks:
14        success: [Build Success]
15priority_rules:
16  - name: renovate
17    conditions:
18      author: renovate[bot]
19    priority: low
// for coding agents

Written for people and for agents.

An agent that helps you set up a queue finds on this site everything you find, in Markdown.

  • Start at /llms.txt, or read every page in /llms-full.txt.
  • Each page is Markdown at its URL with .md, or with Accept: text/markdown.
  • The JSON Schema of .cihub.yaml and the OpenAPI document of the API.
Use CIHub with a coding agent

Your first merged pull request
in about 30 minutes.

A GitHub App, a Helm chart and a Postgres. Then comment /cihub merge.