CodeRabbit Retrigger #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: CodeRabbit Retrigger | |
| # Periodically scans open PRs and posts `@coderabbitai review` on any whose | |
| # rate-limit window has elapsed. CodeRabbit ignores comments authored by a | |
| # GitHub App, so this workflow uses a personal access token (`RABBIT_PAT`) | |
| # scoped to the `Review` environment. | |
| on: | |
| schedule: | |
| # Every 20 minutes. CodeRabbit Pro reviews 5 PRs/hr, so this gives | |
| # ~3 ticks per hour — enough to catch elapsed windows without thrashing. | |
| - cron: "*/20 * * * *" | |
| workflow_dispatch: | |
| inputs: | |
| max: | |
| description: "Max retriggers this run (CR Pro = 5/hr)" | |
| required: false | |
| default: "5" | |
| dry_run: | |
| description: "Print what would be done; post nothing" | |
| type: boolean | |
| required: false | |
| default: false | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| concurrency: | |
| group: rabbit-retrigger | |
| cancel-in-progress: false | |
| jobs: | |
| retrigger: | |
| name: Retrigger CodeRabbit | |
| runs-on: ubuntu-22.04 | |
| # CodeRabbit ignores `@coderabbitai review` comments posted under a | |
| # GitHub App identity, so this workflow uses a personal access token | |
| # scoped to the `Review` environment instead. Set `RABBIT_PAT` on the | |
| # `Review` environment in repo settings — a fine-grained PAT with | |
| # `pull-requests: write` and `issues: write` on this repo is enough. | |
| environment: Review | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24.x | |
| - name: Run rabbit | |
| env: | |
| GH_TOKEN: ${{ secrets.RABBIT_PAT }} | |
| RABBIT_REPO: ${{ github.repository }} | |
| run: | | |
| set -e | |
| ARGS=(run --max "${{ inputs.max || '5' }}") | |
| if [ "${{ inputs.dry_run }}" = "true" ]; then | |
| ARGS+=(--dry-run) | |
| fi | |
| node scripts/rabbit/cli.mjs "${ARGS[@]}" |