Merge queues for pull requests can increase the rate at which pull requests are merged into a busy default branch, whilst ensuring that CI checks pass.
Merge queues use GitHub Actions. For more information about actions, see "GitHub Actions."
Once a pull request has passed any required checks and approvals, a contributor with write access can add the pull request to the merge queue. The queue then creates a temporary branch with that pull request and any pull requests ahead of it in the queue, and triggers any required continuous integration (CI) checks.
The merge queue creates temporary preparatory branches to validate pull requests against the latest version of the base branch. To ensure that GitHub validates these preparatory branches, you may need to update your CI configuration to trigger builds on branch names starting with
For example, with GitHub Actions, adding the following trigger to a workflow will cause the workflow to run when any push is made to a merge queue preparatory branch that targets
on: push: branches: - gh/readonly/queue/main/**
Once CI checks pass, GitHub Enterprise Cloud merges the pull request by fast-forwarding the default branch. The merge queue will use merge commits if the "Require linear history" branch protection setting is turned off, and the "Rebase and merge" method otherwise.
Note: During the beta, there are some limitations when using the merge queue:
- The merge queue cannot be enabled on branch protection rules using wildcards (
*) in the name.
- There is no support for squash merge commits. (Only merge commits and "rebase and merge" commits are supported.)
If there are failed status checks or conflicts with the base branch, GitHub Enterprise Cloud will remove the pull request from the queue. The pull request timeline will display the reason why the pull request has been removed from the queue.
Repository administrators can configure merge queues for pull requests targeting selected branches of a repository. The requirement to use a merge queue is a branch protection setting called "Require merge queue" that can be enabled in branch protection rules.
For information about how to enable the merge queue protection setting, see "Managing a branch protection rule."