Conversation
Enable automated PR reviews using the centralized reusable workflow. Uses Claude Code's default model (currently Opus 4.6). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
WalkthroughA new GitHub Actions workflow file is introduced that automatically triggers on pull request events (opened and synchronized) and delegates code review execution to an external workflow from shakacode/.github, passing the required OAuth token secret. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/claude-code-review.yml:
- Around line 7-11: The claude-review job currently calls the reusable workflow
via the uses: shakacode/... line but lacks the explicit permissions required by
that external workflow; update the claude-review job to include a permissions
block with contents: read, pull-requests: write, issues: write, and id-token:
write so the caller grants least-privilege access expected by the external
workflow.
🧹 Nitpick comments (2)
.github/workflows/claude-code-review.yml (2)
3-5: Consider adding thereopenedevent type.The workflow currently triggers on
openedandsynchronizeevents. Addingreopenedensures that when a closed PR is reopened, it will also trigger the Claude Code review, providing consistent coverage.♻️ Proposed enhancement
on: pull_request: - types: [opened, synchronize] + types: [opened, synchronize, reopened]
9-9: Consider pinning to a specific version or tag for reliability.The workflow references
@main, which is mutable and could introduce unexpected breaking changes if the external workflow is updated. Pinning to a specific version or tag (e.g.,@v1.0.0) provides better stability and predictability.If your organization prefers using
@mainfor easier centralized updates across repositories, that's a valid strategy—just be aware of the reliability trade-off. You might also consider using@maininitially and switching to pinned versions once the workflow is stable.
| jobs: | ||
| claude-review: | ||
| uses: shakacode/.github/.github/workflows/claude-code-review.yml@main | ||
| secrets: | ||
| CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Fetch the external workflow file to check its permission requirements
curl -s https://raw.githubusercontent.com/shakacode/.github/main/.github/workflows/claude-code-review.yml | head -200Repository: shakacode/sass-resources-loader
Length of output: 911
Add explicit permissions to match the external workflow's requirements.
The external reusable workflow at shakacode/.github/.github/workflows/claude-code-review.yml explicitly requires:
contents: read(to checkout and read repository code)pull-requests: write(to post code review comments on PRs)issues: write(to post code review comments on issues)id-token: write(for token exchange with external services)
Add these permissions explicitly to the calling workflow to follow the principle of least privilege and ensure clarity of intent:
Suggested fix
jobs:
claude-review:
permissions:
contents: read
pull-requests: write
issues: write
id-token: write
uses: shakacode/.github/.github/workflows/claude-code-review.yml@main
secrets:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}🤖 Prompt for AI Agents
In @.github/workflows/claude-code-review.yml around lines 7 - 11, The
claude-review job currently calls the reusable workflow via the uses:
shakacode/... line but lacks the explicit permissions required by that external
workflow; update the claude-review job to include a permissions block with
contents: read, pull-requests: write, issues: write, and id-token: write so the
caller grants least-privilege access expected by the external workflow.
Summary
shakacode/.githubCLAUDE_CODE_OAUTH_TOKENsecret (org-level or repo-level)Test plan
CLAUDE_CODE_OAUTH_TOKENsecret is available (org or repo level)🤖 Generated with Claude Code
Summary by CodeRabbit