Using GitHub merge queues

Merge queues are a feature of GitHub to improve development velocity on busy branches. They can increase the rate at which pull requests are merged into a branch while ensuring all the required branch protection checks pass. Merge queues preserve the order of pull requests to merge, remove redundant builds, and reduce flaky merges.

Before you start

Familiarize yourself with managing a merge queue in GitHub.

Enable a merge queue for a pipeline

The merge queue creates temporary branches with a special prefix to validate pull request changes. You need to update the pipeline configuration to match branches with the special prefix if you are already using branch filters. To avoid these temporary branches triggering multiple builds on the same pipeline for the same commit, it is recommended you enable the option to skip builds on existing commits.

To enable a merge queue for a pipeline:

  1. From your Buildkite dashboard, select your pipeline.
  2. Select Pipeline Settings > GitHub.
  3. In the GitHub Settings section, select the Skip builds with existing commits checkbox.
  4. If you are already using branch filters in the Branch Limiting section, add another filter for the following pattern:

    gh-readonly-queue/{base_branch}/*
    

    Otherwise, leave the branch filter text box blank, and builds will be triggered for GitHub merge queue branches automatically.

That's it! Your pipeline supports merge queues in GitHub. 🎉