Fix Claude Code Review workflow comment tooling#113
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ 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 |
Greptile SummaryThis PR migrates the Claude Code review workflow from a centralized reusable workflow to an inline definition with explicit tool permissions. The changes enable Claude to post feedback directly as GitHub PR comments instead of using sticky-comment mode. Key changes:
The workflow correctly maintains all necessary permissions ( Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[PR Event Triggered] --> B{Event Type?}
B -->|opened| C[Start Claude Review Job]
B -->|synchronize| C
B -->|ready_for_review| C
B -->|reopened| C
C --> D[Checkout Repository]
D --> E[Run Claude Code Action]
E --> F{Review Analysis}
F --> G[gh pr comment]
F --> H[mcp__github_inline_comment__create_inline_comment]
G --> I[Top-level PR Comments]
H --> J[Inline Code Comments]
I --> K[Review Posted to GitHub]
J --> K
Last reviewed commit: d433353 |
There was a problem hiding this comment.
Pull request overview
This PR updates the Claude Code Review workflow to enable Claude to post feedback directly as GitHub PR comments instead of using a sticky comment mode. The change migrates from using a reusable workflow to a self-contained workflow with explicit steps and tool configurations.
Changes:
- Replaces reusable workflow reference with inline job definition
- Adds explicit prompt instructions for Claude to use GitHub commenting tools
- Configures allowed tools via
claude_argsparameter - Extends PR trigger types to include
ready_for_reviewandreopened
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| uses: shakacode/.github/.github/workflows/claude-code-review.yml@main | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read |
There was a problem hiding this comment.
The workflow is missing the 'actions: read' permission that is present in the claude.yml workflow. According to the comment in claude.yml (line 26), this permission is "Required for Claude to read CI results on PRs". Consider adding this permission if Claude should be able to read CI results during code review, which would be valuable for providing more comprehensive feedback.
| contents: read | |
| contents: read | |
| actions: read |
| Only post GitHub comments - don't submit review text as messages. | ||
|
|
||
| claude_args: | | ||
| --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" |
There was a problem hiding this comment.
The argument uses '--allowedTools' (camelCase) but the example in claude.yml (line 49) shows '--allowed-tools' (with hyphen). Verify which format is correct for the Claude Code Action. If the correct format is '--allowed-tools', this should be updated to match the documented format.
| --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" | |
| --allowed-tools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" |
| id: claude-review | ||
| uses: anthropics/claude-code-action@v1 | ||
| with: | ||
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} |
There was a problem hiding this comment.
If the 'actions: read' permission is added to the permissions block (as suggested in another comment), you should also add the 'additional_permissions' configuration to the action inputs, similar to lines 40-41 in claude.yml. This ensures Claude can properly utilize the actions permission.
This ports the Claude Code review workflow fix from shakacode/hichee-data#367:
claude_args --allowedToolsThis makes Claude review output appear as top-level and inline PR comments.