Documentation Index
Fetch the complete documentation index at: https://trunk-4cab4936-mintlify-migrate-docs-changes-1778515731.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before configuring branch protection:- Trunk GitHub App installed and queue created (previous step)
- Repository has CI/CD configured (GitHub Actions, CircleCI, etc.)
- CI runs on pull requests and reports status checks to GitHub
- You have admin access to repository settings
How Trunk Merge Queue works
Trunk Merge Queue respects GitHub’s branch protection rules and works with both Classic branch protection rules and Rulesets. Since Merge Queue ultimately merges pull requests through GitHub, any protection rules on your target branch (like required code reviews or status checks) will still apply.Choose your testing approach
Trunk Merge Queue can test pull requests in two ways. Choose the approach that fits your CI setup:Draft PR mode (Recommended - Default)
Best for: Most teams who want the simplest setup with no additional configuration.
- No additional CI configuration required
- Works immediately with your existing workflows
- Simple to set up and maintain
- This mode also creates a
trunk-merge/branch - Trunk automatically closes the draft PRs and merge the original PRs
Push-Triggered mode (Advanced)
Best for: Teams who need different CI behavior for merge queue testing versus pull request review.
trunk-merge/* branch and pushes to it. You configure specific CI jobs to run on these branches.
Advantages:
- Complete control over which jobs run during queue testing
- Avoid triggering expensive preview environments or review-only workflows
- Can optimize for faster merge queue throughput
- Configure push-triggered workflows in your CI provider for
trunk-merge/**branches - Define required status checks in your
.trunk/trunk.yamlconfiguration file
Configure Branch Protection Rules
Using Rulesets vs. Classic Rules
You can use GitHub’s Rulesets feature alongside Classic branch protection rules—both systems work together. However, push permission restrictions must be configured using Classic branch protection rules only because GitHub’s API does not expose push restriction settings from Rulesets. All other branch protection settings (required reviews, status checks, signed commits, etc.) can be configured using either Classic rules or Rulesets.Configure Push Restrictions (Required)
Trunk Merge Queue needs permission to push to your protected branch. Configure these settings using Classic branch protection rules:- Go to Settings > Branches in your repository on GitHub.
- Edit or create a Classic branch protection rule for your target branch (e.g.,
main) - Under “Rules applied to everyone including administrators,” select:
- Restrict who can push to matching branches
- Restrict pushes that create matching branches
- Add the
trunk-iobot to the list of allowed actors - Optionally, add Organization admins and repository admins who need emergency merge access
- Save your changes
Exclude Trunk’s temporary branches (Critical)
Trunk Merge Queue creates temporary branches to test pull requests before merging them:trunk-temp/*- Temporary testing branchestrunk-merge/*- Merge testing branches
- Go to Settings > Branches in your repository
- Review all Classic branch protection rules
- Check for wildcard patterns like
*/*,**/*, or similar that would matchtrunk-temp/*ortrunk-merge/* - If you find matching rules, either:
- Option A: Remove the wildcard rules and create more specific rules for your actual branches
- Option B: Add the
trunk-iobot to the bypass list for those rules
*/* would protect all branches including trunk-temp/* and trunk-merge/*.
What happens if these branches are protected: Merge Queue will encounter GitHub permission errors and display messages like “Permission denied on trunk-merge/* branch.”