How to Enable the GitHub Merge Queue
The merge queue is enabled per branch through a branch protection rule or ruleset, then activated by requiring it before merging.
Enable the merge queue on the target branch in branch protection (or a ruleset), then add the merge_group trigger to the workflow that produces your required checks so those checks run against the queued merge candidate.
Steps
- Open Settings to Branches (or Settings to Rules) and edit the rule for the default branch.
- Enable "Require merge queue" and set the grouping and batching limits.
- Keep "Require status checks to pass" on and list the checks the queue must satisfy.
- Add
on: merge_groupto the workflow that runs those checks.
Enable the queue
Settings
Settings > Branches > Branch protection rule (main)
[x] Require merge queue
Merge method: Squash
Build concurrency: 5
Minimum group size: 1
Maximum group size: 5
Wait time to build: 5 minutesWire the workflow to the queue
.github/workflows/ci.yml
on:
merge_group:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm testGotchas
- A required check that never runs on
merge_groupleaves the queue entry stuck pending; see the stuck "expected" check guide. - Only repositories with branch protection or rulesets can require the queue; forks and unprotected branches cannot.
Related guides
How to Use the merge_group Trigger in GitHub ActionsAdd the merge_group event to a GitHub Actions workflow so required checks run against the temporary merge que…
How to Configure Required Status Checks With the Merge QueueSelect which status checks the GitHub merge queue must pass, and make sure every required check runs on the m…
How to Fix a Merge Queue Stuck on an Expected CheckResolve a merge queue entry that sits pending forever because a required check is listed as expected but neve…