Repository navigation
ci: restrict GITHUB_TOKEN permissions - #3290
Conversation
Add explicit least-privilege `permissions` blocks to the workflows CodeQL flagged under `actions/missing-workflow-permissions`, so the GITHUB_TOKEN falls back to `contents: read` instead of inheriting repository defaults. All flagged jobs only read the repository: pushes in autofix.yml and the cross-repo dispatch in images.yml use dedicated PATs (GH_TOKEN / GH_INFRA_TOKEN), and the e2e artifact steps use the same-run artifact API, so none of them need write scopes on the workflow token. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01368Ax2WpJaKG32ySXDKKX7
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 44 seconds Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Resolves the ten open CodeQL
actions/missing-workflow-permissionsalerts (#89, #81, #37, #35, #10, #7, #6, #5, #4, #3) by giving every flagged workflow job an explicit least-privilegepermissionsblock, soGITHUB_TOKENno longer falls back to the repository default (read-write for repos created before Feb 2023).Changes
run.ymlcontents: readci.ymlcontents: read(coversqualityplus the fourrun.ymlcaller jobs)e2e.ymlcontents: readautofix.ymlcontents: readimages.ymlcontents: readonsetupandtrigger-infra-update— the file's other jobs already scope their own permissions, so this matches the existing styleWhy
contents: readis sufficient everywhereEvery flagged job only reads the repository; the writes in these workflows are already done with dedicated PATs rather than the workflow token:
autofix.ymlpassestoken: ${{ secrets.GH_TOKEN }}to the autofix action, which is what pushes the fixup commit.images.yml→trigger-infra-updatedispatches into a different repository withGH_TOKEN: ${{ secrets.GH_INFRA_TOKEN }}.images.yml→setupjust checks out and computes an image tag.e2e.yml'supload-artifact/download-artifactsteps operate on same-run artifacts, which use the runtime artifact API and need no token scope.run.ymlsetsGITHUB_TOKENon the command step, but nothing in the build/lint/setup scripts reads it — it only serves to raise API rate limits during dependency resolution.run.ymlis a reusable workflow, so itscontents: readis a subset of whatci.ymlnow grants and does not conflict.Verification
prettierreports all five touched files unchanged (already correctly formatted).Generated by Claude Code