Skip to main content
Set up an Auto-fix automation that pushes fixes to a pull request when a CI check fails or CodeRabbit posts findings.

What you get

  • When a CI check fails or CodeRabbit posts findings on a pull request that meets the automation’s conditions, the Coding Agent pushes a fix commit to its branch.
  • The automation acts on future matches only, after new activity arrives, such as a CI run or a review comment. A pull request that was already failing when you saved waits for its next activity.
  • Each repair is a Coding Agent run and can cost money. See Coding Agent access and billing.
What CodeRabbit won’t do:
  • Repair a pull request that doesn’t meet the conditions.
  • Approve or merge the pull request. To merge it, see Merge low-risk pull requests automatically.
  • Act on reviewers’ comments. The automation repairs failed CI checks and CodeRabbit findings only.
To stop, select Pause on the automation’s row in PR Automations, or delete it. A repair already in progress can still push its commit. Commits the automation pushed stay on the branch, and you revert them like any other commit.

Before you start

| If your branch rule dismisses stale approvals, a fix commit pushed after an approval needs a fresh approval.

1. Create the Auto-fix automation

Once saved, this automation pushes commits to the branches of matching pull requests without asking first. The author and reviewers see each commit, and each run can cost money. Start with a test repository if you have one.
1

Start from the template

In PR Automations, select Try now on Auto-fix PRs. The editor opens with all repositories and the trigger condition PR state is Open.
2

Optional: Repair only some pull requests

To narrow the repairs, add a condition for each property a pull request must have, such as Merge risk or Review depth: under Triggers, select the + on the trigger card and set the condition. The conditions show and between them. Don’t use Add trigger: it adds a separate trigger joined by OR. If you’re following Take low-risk pull requests from open to merged, add Merge risk is any of Minimal, Low and Review depth is Light.
3

Choose the repository

Under Repositories, choose Selected and pick the repository. It gets its own card.
4

Optional: Limit it to pull requests you opt in

To keep repairs away from pull requests 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. Without this filter, once you save, the automation repairs every pull request in the repository that matches from then on.
5

Choose what to fix

In Address, keep Failed CI checks and CodeRabbit findings selected.
6

Choose the timing

Choose Automatically to repair as soon as a problem appears, or After a set time to give the author a chance to fix it first.
7

Optional: Limit what repairs change

To keep repairs inside the original change, describe the limits in Additional instructions, such as not changing public APIs or feature-flag defaults.
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.

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.
2

Break a check

Push a commit that fails a CI check.
3

Optional: Check the conditions you added

If you narrowed the repairs, check that the pull request meets your conditions. For the low-risk ones, once CodeRabbit has reviewed the latest commit, the failing one, the Merge Risk line in CodeRabbit’s summary comment shows Minimal or Low and the Triage card shows Light review. You can’t force either rating. Until CodeRabbit has reviewed that commit, or if either shows anything else, the automation doesn’t act. To show review depth on cards, see What you can toggle.
4

Check the outcome

After the failed check reports, the Coding Agent pushes a fix commit to the branch, right away or after the delay you set. 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 repairs only where you expect them, so the automation repairs every pull request in the repository that meets its conditions.
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 automation.

If something doesn’t work

  • The automation didn’t act. Check that the pull request meets the automation’s conditions, then check the automation’s status and the pull request’s outcome in View activity. See An automation rule did not run.
  • A repair didn’t arrive. The organization may have lost Coding Agent access, or the repository may be on a provider or deployment that Auto-fix doesn’t support. See Coding Agent access.

Variations

What’s next

Merge low-risk pull requests automatically

Merge low-risk pull requests once your conditions are met and the required checks pass.

Remind reviewers in Slack

Nudge authors and reviewers about pull requests that wait for review.

Coding Agent access and billing

Check who can use the Coding Agent and how its runs are counted.