> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coderabbit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Search and read these docs from your coding agent with the [CodeRabbit documentation MCP server](https://docs.coderabbit.ai/mcp).
> Give your coding agent the [CodeRabbit Agent Skill](https://docs.coderabbit.ai/.well-known/agent-skills/index.json) for configuring reviews, running CLI reviews, coding tasks and API calls.

# Merge low-risk pull requests automatically

> Have CodeRabbit merge low-risk pull requests once your conditions are met and the required checks pass, with or without a person's approval.

Set up a PR Automation that merges a low-risk pull request once your conditions are met and the required checks pass.

## Choose a setup

| Setup | What gates the merge | Pick it when |
| - | - | - |
| **Merge on conditions and checks** | The **Merge low-risk changes** template as is. GitHub's required checks and branch rules are the gate, and nothing waits for a person. | Your required checks are enough to trust a low-risk change. |
| **Also require a person's approval** | The template plus the condition **Provider review decision** **is** **Approved**, and a branch rule that needs a person's approval. | Someone must sign off on every change before it merges. |

## What you get

* The automation selects open pull requests whose [Merge risk](https://docs.coderabbit.ai/pr-reviews/merge-risk.md) is **Minimal** or **Low** and whose **Review depth** is **Light**.
* CodeRabbit merges with its GitHub App, so your branch rules apply to it. If the branch requires a merge queue, CodeRabbit adds the pull request to the queue.
* With **Merge on conditions and checks**, any matching pull request that meets GitHub's requirements merges, with no approval unless your branch rule requires one.
* With **Also require a person's approval**, a pull request merges only after a person approves its latest commit, whether or not CodeRabbit approves too. If a commit lands after the approval, the automation checks again on the new commit and waits for a fresh approval.
* Pull requests that already match when you save merge only if you select them.

To stop, select **Pause** on the automation's row in [PR Automations](https://app.coderabbit.ai/triage/settings), or delete it. CodeRabbit re-checks the conditions before it merges, so a pull request that stops matching before the merge, such as one whose label you remove during setup, doesn't merge. None of these takes a pull request out of GitHub's merge queue or undoes a merge, which you revert in GitHub.

## Before you start

GitHub Cloud (This guide is written for GitHub Cloud (github.com). Other providers support fewer of its steps.) | Team Plan (This feature is available on Team (formerly Pro+), Advanced, and Enterprise. Please refer to our pricing page for more information about our plans and features.)

| Requirement | Who does it | Where |
| - | - | - |
| Permission to enable automations that merge | CodeRabbit organization administrator | [PR Automations](https://app.coderabbit.ai/triage/settings) |
| The [branch rule](#branch-rule) for your setup, described below | Repository administrator in GitHub | [Configure GitHub](https://docs.coderabbit.ai/pr-reviews/approval-policies.md#configure-github) |
| Optional: Coding Agent access for the organization, for repairs before the merge | CodeRabbit organization administrator | [Coding Agent access](https://docs.coderabbit.ai/code/access-and-billing.md#access) |
| Recommended for setup: a `triage-trial` label in the repository | Someone with write access to the repository | GitHub: **Issues** > **Labels** |

If the Auto-fix automation from [Repair failing pull requests automatically](https://docs.coderabbit.ai/triage/guides/repair-failing-pull-requests.md) already runs on these pull requests, step 1 turns off this automation's own repairs, so only one of them pushes fixes.

Optional: To tell CodeRabbit what counts as low risk for your team, describe it in [Merge Risk Instructions](https://docs.coderabbit.ai/pr-reviews/merge-risk.md#guide-merge-risk).

### Branch rule

For either setup, in the branch rule that protects the target branch:

* Require the status checks that must pass before a merge.
* Keep the CodeRabbit GitHub App off the ruleset's bypass list. For classic branch protection, turn on **Do not allow bypassing the above settings**.

> [tab] Merge on conditions and checks
>
> No approval requirement is needed. If the rule already requires approvals, GitHub still enforces them, and the merge waits for them.
>
> To check the rule before you create the automation, open a pull request against the branch. GitHub blocks merging until the required checks pass.

> [tab] Also require a person's approval
>
> In the same rule:
>
> * Require enough approvals that a person must approve: one if CodeRabbit doesn't approve pull requests, as by default, or two if you use [Automatic approvals](https://docs.coderabbit.ai/pr-reviews/automatic-approvals.md). See [CodeRabbit plus a person](https://docs.coderabbit.ai/pr-reviews/approval-policies.md#coderabbit-plus-a-person).
> * Dismiss stale approvals when new commits are pushed.
> * Optional: To require a specific person or team, add them to a CODEOWNERS file on the target branch and turn on **Require review from Code Owners**.
>
> With this setup, a merge needs a person's approval of the latest commit. If another bot approves pull requests, require one more approval for each such bot.
>
> To check the rule before you create the automation, open a pull request against the branch. GitHub reports that a review is required and blocks merging until someone approves.

## 1. Create the merge automation

> [!CAUTION]
>
> Once saved, this automation merges matching pull requests into your protected branch as soon as they meet GitHub's requirements, with nobody pressing merge. You undo a merge only by reverting it in GitHub.

**1. Start from the template**

In [PR Automations](https://app.coderabbit.ai/triage/settings), select **Try now** on **Merge low-risk changes**. The editor opens with all repositories, the trigger conditions **PR state** is **Open**, **Merge risk** is any of **Minimal**, **Low**, and **Review depth** is **Light**, and a **Squash** merge with auto fix on.

**2. Optional: Require a person's approval**

If you chose **Also require a person's approval**, under **Triggers**, select the **+** on the trigger card and set the new condition to **Provider review decision** **is** **Approved**. The conditions show **and** between them. Don't use **Add trigger**: it adds a separate trigger joined by OR, which can merge without an approval.

**3. Choose the repository**

Under **Repositories**, choose **Selected** and pick the repository. Use a test repository first if you have one. The repository gets its own card.

**4. Optional: Limit it to pull requests you opt in**

To keep the automation from merging a pull request you didn't mean to include while you check the results, on the repository's card, select the **+**, set the new filter's property to **PR labels**, keep **has any of**, and choose `triage-trial`. Anyone who can label pull requests, including the author, can opt one in. Without this filter, once you save, the automation merges every pull request in the repository that matches from then on.

**5. Choose who repairs**

If the Auto-fix automation already repairs these pull requests, or your organization has no Coding Agent access, set **if PR requires fixes** to **Do not auto fix**. Otherwise, keep **Auto fix** to repair failed checks and CodeRabbit findings before the merge. Each repair is a Coding Agent run that pushes a commit and [can cost money](https://docs.coderabbit.ai/code/access-and-billing.md).

**6. Choose the merge method**

In **merge method**, choose a method your branch rules allow. A branch that requires a merge queue always uses the queue.

**7. Optional: Limit merge hours**

To merge only while your team is around, set **merge at** to **During selected hours**, then select **Merge hours** and choose the days, hours, and timezone.

**8. Save and enable**

Select **Save automation**. This saves and enables it for future matches only. Without administrator access, the button reads **Save as paused**, and the automation doesn't run until an administrator turns it on.

## 2. Optional: Merge pull requests that already match

**1. Open the matches**

On the automation's row in PR Automations, select **Preview matches**. It appears only when something matches.

**2. Select pull requests**

Select the pull requests to merge now, then select **Review selection**.

**3. Confirm**

Confirm the selection. Each pull request merges once GitHub's requirements pass.

## Test it

**1. Open a pull request**

In the repository you selected, open a small, contained pull request. If you set the label filter, add the `triage-trial` label. The pull request doesn't merge before the required checks pass.

**2. Check the rating**

Check that the **Merge Risk** line in CodeRabbit's summary comment shows **Minimal** or **Low** for the latest commit and that the pull request's Triage card shows **Light review** before you expect a merge. You can't force either rating. Until CodeRabbit has reviewed the latest commit, or if either shows anything else, the automation doesn't act on this pull request. To show review depth on cards, see [What you can toggle](https://docs.coderabbit.ai/triage/your-triage-view.md#what-you-can-toggle).

**3. Optional: Approve as a person**

If you chose **Also require a person's approval**, ask a teammate to approve the latest commit, since GitHub doesn't let authors approve their own pull requests. Until then, GitHub reports that a review is required, and the pull request doesn't merge.

**4. Check the outcome**

Once the required checks pass, and the approval if you require one, the pull request merges, or its Triage card shows **Queued to merge**. In PR Automations, select **View activity** to see the automation's run on the pull request.

## Widen the scope

If you set the label filter, remove it once **View activity** shows merges only where you expect them. From then on, the automation merges every pull request in the repository whose Merge risk is **Minimal** or **Low** and whose **Review depth** is **Light**, once it meets your setup's requirements.

**1. Open the automation**

In PR Automations, select the pencil icon on the automation's row.

**2. Remove the label filter**

On the repository's card, select the **X** on the **PR labels** filter.

**3. Save**

Select **Save changes**. When **if PR requires fixes** is set to **Auto fix**, the button reads **Save automation**. Pull requests that already match merge only if you select them in **Preview matches**.

## If something doesn't work

* **The automation didn't act.** Check that the pull request's ratings match [Test it](#test-it), then check the automation's status and the pull request's outcome in **View activity**. See [An automation rule did not run](https://docs.coderabbit.ai/triage/troubleshooting.md#an-automation-rule-did-not-run).

## Variations

* **Merge only the pull requests a person picks.** Start from **Merge labeled changes** in place of **Merge low-risk changes**. It has no **Merge risk** or **Review depth** conditions, so the label filter stays for good and a person chooses every pull request. To also require an approval, add **Provider review decision** **is** **Approved** the same way. See [Start with a template](https://docs.coderabbit.ai/triage/rules.md#start-with-a-template).
* **GitLab or Bitbucket.** Support differs by provider and deployment, so check [Provider availability](https://docs.coderabbit.ai/triage/rules.md#provider-availability). Where the provider can't repair before merging, set **if PR requires fixes** to **Do not auto fix**, because the default **Auto fix** blocks matching pull requests. **Provider review decision** isn't available on every provider, and **PR labels** filters work on GitLab but not on Bitbucket.

## What's next

> [card] [Repair failing pull requests automatically](https://docs.coderabbit.ai/triage/guides/repair-failing-pull-requests.md)
>
> Fix failed checks and CodeRabbit findings on low-risk pull requests before they merge.

> [card] [Remind reviewers in Slack](https://docs.coderabbit.ai/triage/guides/remind-reviewers-in-slack.md)
>
> Nudge authors and reviewers about low-risk pull requests that wait for review.

> [card] [Approval policies](https://docs.coderabbit.ai/pr-reviews/approval-policies.md)
>
> Decide which approvals, if any, your branch rules require before anything merges.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.