Platform support
Fix CI failures is available on GitHub only.GitHub
GitHub Cloud and GitHub Enterprise Server (self-hosted).
Usage
On supported GitHub pull requests, CodeRabbit can show two Fix failing CI delivery options in the ✨ Finishing Touches section of the comment when it detects failing CI checks:- Create stacked PR: Open a pull request containing the generated fixes, targeting the current pull request branch.
- Commit on current branch: Commit the generated fixes directly to the pull request branch.
- Stacked pull request
- Direct commit
The checkbox options appear only when CodeRabbit detects failing CI checks during or shortly after review. If they are not present and the commands are available, use
@coderabbitai fix-ci or @coderabbitai fix-ci commit manually. If neither trigger is available, see Troubleshooting.How it works
1
Trigger
Choose Create stacked PR or Commit on current branch in the Walkthrough comment. You can also comment
@coderabbitai fix-ci for a stacked pull request or @coderabbitai fix-ci commit for a direct commit. CodeRabbit collects the checks reported as failing on the PR’s head commit.2
Investigate
CodeRabbit clones the repository into a sandbox and gathers context for the failing checks: the available failure output and the relevant CI configuration for the jobs that ran. This tells the agent what failed and how each job is invoked, rather than guessing from the check name alone.
3
Fix
A coding agent works directly in the repository, reading files and editing code to address the failures. It focuses on the code under test: infrastructure and configuration files (CI and build config, lock files, and other dependency manifests) are left out of the change and surfaced separately so you can apply them yourself if they are genuinely needed.
4
Deliver
CodeRabbit either opens a stacked pull request targeting the current branch or commits the fix directly to that branch, based on the selected checkbox or command. The status comment lists the failing checks it addressed and the files it changed.
Re-running the fix
Re-running Fix CI behaves like a retry, and where the changes land depends on which pull request you trigger it from:- Stacked pull request: Use
@coderabbitai fix-cior Create stacked PR on the original pull request to open a separate pull request for the current failures. - Direct commit: Use
@coderabbitai fix-ci commitor Commit on current branch to add the next fix to the current pull request branch. - Retry on a CodeRabbit-created stacked pull request: CodeRabbit commits the next fix directly to that pull request instead of creating an endlessly growing stack.
Scope and limitations
- GitHub only. Fix CI failures is not available on GitLab, Azure DevOps, or Bitbucket.
- Delivery options depend on repository access. Direct commit requires permission to write to the pull request branch. Stacked delivery requires permission to create a branch and pull request.
- Target-branch CI filters can affect stacked pull requests. If your CI only runs on pull requests targeting specific branches (for example
main), it may not run on the stacked pull request itself. Merge the stacked pull request into your branch so CI validates on the original pull request. - Infrastructure and dependency files are not committed. Changes the agent makes to CI/build config, lock files, or other dependency manifests are excluded from the delivered changes and listed in the status comment so you can apply them manually.
- Workflow files are excluded. CodeRabbit cannot commit changes under
.github/workflows/. If a fix requires editing a workflow file, it is surfaced in the status comment for you to apply.
Command reference
@coderabbitai fix ci and @coderabbitai fixci. Add commit to any of these commands to request a direct commit.
Configuration
Fix CI failures is enabled by default for eligible repositories. To turn it off, set the following in your.coderabbit.yaml:
Troubleshooting
The fix-ci command or checkbox isn't available
The fix-ci command or checkbox isn't available
Fix CI failures requires a Pro Plus plan and is available on GitHub only. Confirm the repository is on a Pro Plus plan and that the pull request is on GitHub. If it was turned off in configuration, set
reviews.finishing_touches.fix_ci.enabled to true. The checkbox options appear only when CodeRabbit detects failing CI checks during review or shortly after the review finishes. If your CI fails later, the options may not appear; use @coderabbitai fix-ci or @coderabbitai fix-ci commit manually if the commands are available.The agent only changed configuration files
The agent only changed configuration files
Infrastructure, CI/build config, and dependency files are intentionally left out of direct commits and stacked pull requests. If the only changes the agent produced were out of scope, no fix commit or pull request is created; the status comment lists the files it touched so you can apply them manually.
The stacked PR's CI still fails
The stacked PR's CI still fails
The stacked pull request runs your real CI, which may surface remaining or new failures. Trigger Fix CI on the stacked pull request to have CodeRabbit commit another fix directly to it, or use
@coderabbitai fix-ci on your original pull request to open a fresh stacked pull request. You can also choose one of the Fix failing CI delivery options when available or resolve the remaining failures manually.What’s next
Finishing Touches overview
See all available finishing touches and how to trigger them from any PR
Autofix
Automatically implement fixes for unresolved CodeRabbit review findings
Resolve merge conflicts
Let CodeRabbit analyze the intent behind conflicting changes and commit a clean resolution to your branch