Automatically retry CodeRabbit reviews when they fail due to rate limiting. This is currently generated using Claude and merely reviewed by me.
CodeRabbit is an excellent AI code review tool, but it can occasionally hit rate limits during high-activity periods. This action monitors your open PRs and automatically requests a re-review when:
- The latest commit hasn't been reviewed by CodeRabbit
- CodeRabbit left a comment containing "Rate Limit exceeded"
- No retry has been requested within the cooldown period
Create .github/workflows/coderabbit-retry.yml:
name: CodeRabbit Retry
on:
schedule:
- cron: '0 * * * *' # Run every hour
workflow_dispatch: # Allow manual trigger
jobs:
retry:
runs-on: ubuntu-latest
steps:
- name: Retry CodeRabbit Reviews
uses: idrinth/coderabbit-retry-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}name: CodeRabbit Retry
on:
schedule:
- cron: '0 * * * *'
workflow_dispatch:
inputs:
dry-run:
description: 'Dry run mode'
type: boolean
default: false
jobs:
retry:
runs-on: ubuntu-latest
steps:
- name: Retry CodeRabbit Reviews
uses: idrintj/coderabbit-retry-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
max-retries: '4'
cooldown-hours: '2'
ignore-branches: 'dependabot/*,renovate/*,release/*'
ignore-labels: 'skip-coderabbit,wip,draft'
dry-run: ${{ inputs.dry-run || 'false' }}| Input | Description | Required | Default |
|---|---|---|---|
github-token |
GitHub token with pull-requests: write permission |
Yes | - |
max-retries |
Maximum retry requests per workflow run | No | 4 |
cooldown-hours |
Hours to wait before retrying the same PR | No | 2 |
dry-run |
Log actions without posting comments | No | false |
ignore-branches |
Comma-separated branch patterns to ignore (supports * wildcard) |
No | '' |
ignore-labels |
Comma-separated labels to ignore (PRs with any of these labels are skipped) | No | '' |
| Output | Description |
|---|---|
retries-requested |
Number of retry comments posted |
prs-checked |
Total PRs examined |
prs-skipped |
PRs skipped (already reviewed or no rate limit) |
- name: Retry CodeRabbit Reviews
id: retry
uses: idrinth/coderabbit-retry-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Summary
run: |
echo "Checked ${{ steps.retry.outputs.prs-checked }} PRs"
echo "Requested ${{ steps.retry.outputs.retries-requested }} retries"┌─────────────────────────────────────────────────────────────┐
│ For each open PR │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────┐
│ Get latest commit SHA │
└─────────────────────────┘
│
▼
┌─────────────────────────┐
│ CodeRabbit reviewed │───Yes──▶ Skip PR
│ this commit? │
└─────────────────────────┘
│ No
▼
┌─────────────────────────┐
│ "Rate Limit exceeded" │───No───▶ Skip PR
│ comment exists? │
└─────────────────────────┘
│ Yes
▼
┌─────────────────────────┐
│ Retry requested within │───Yes──▶ Skip PR
│ cooldown period? │
└─────────────────────────┘
│ No
▼
┌─────────────────────────┐
│ Post @coderabbitai │
│ review comment │
└─────────────────────────┘
│
▼
┌─────────────────────────┐
│ Max retries reached? │───Yes──▶ Stop
└─────────────────────────┘
│ No
▼
Next PR...
The action requires these permissions:
permissions:
pull-requests: write
contents: readnpm installnpm run buildImportant: Always run
npm run buildbefore committing. Thedist/folder must be checked in for the action to work.
Use act to test locally:
act schedule -j retryTo prevent spamming PRs with retry requests if CodeRabbit continues to be rate limited. The default 2-hour cooldown balances responsiveness with avoiding noise.
Yes, if you need the action to trigger other workflows:
with:
github-token: ${{ secrets.PAT_TOKEN }}- Check the workflow run logs in the Actions tab
- Enable dry-run mode first to see what would happen
- Look for the action's comments on your PRs
MIT