Fix Claude Code Review workflow: use built-in review#698
Conversation
The plugin-based review setup is broken — the plugin tries to call gh api via the Bash tool, which the action sandbox blocks by default. Removing in favor of the working default claude.yml (@claude mentions). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🚀 Quick Review App CommandsWelcome! Here are the commands you can use in this PR:
|
WalkthroughUpdated the Changes
Sequence Diagram(s)sequenceDiagram
participant GH as GitHub Actions
participant Runner as Actions Runner
participant CCR as Claude Code Review Action
participant GH_API as GitHub PR API
GH->>Runner: trigger workflow on pull_request
Runner->>CCR: invoke action with inputs (use_sticky_comment, prompt)
CCR->>GH_API: read PR contents (requires pull-requests write)
CCR->>GH_API: post/update sticky comment with review (uses issues write)
CCR->>Runner: return status/results
Runner->>GH: set workflow outcome
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
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 |
Greptile SummaryThis PR removes the Key changes:
Confidence Score: 5/5
Important Files Changed
Flowchartflowchart TD
A[Pull Request Opened or Synchronized] --> B{Which Workflow?}
B -->|claude-code-review.yml REMOVED| C[claude-code-action with plugins]
C --> D[Plugin calls gh api via Bash]
D --> E[BLOCKED by action sandbox]
E --> F[Workflow fails - broken]
B -->|claude.yml KEPT| G{Contains @claude mention?}
G -->|Yes| H[claude-code-action standard use]
H --> I[Claude responds to mention]
G -->|No| J[Job skipped]
Last reviewed commit: 5167509 |
…n plugin Replace the plugin-based review (which fails because the sandbox blocks Bash tool access) with the built-in review_triggered_on and use_sticky_comment options. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The action auto-detects review mode from the pull_request trigger. Only use_sticky_comment and prompt are needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/claude-code-review.yml (1)
4-5: Consider skipping draft PRs.The
openedandsynchronizeevents fire on draft PRs, so Claude will trigger a review on every push to a draft — which may burn quota unnecessarily.ready_for_reviewalready handles the draft→ready promotion case.🔧 Suggested guard
jobs: claude-review: runs-on: ubuntu-latest + if: github.event.pull_request.draft == false permissions:🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/claude-code-review.yml around lines 4 - 5, The workflow currently triggers on pull_request types [opened, synchronize, ready_for_review, reopened], which causes reviews to run for draft PR pushes; update the pull_request trigger so opened/synchronize do not fire for drafts — either remove opened and synchronize and rely on ready_for_review/reopened, or keep them but add a guard that checks github.event.pull_request.draft == false before running the job (referencing the pull_request/types and github.event.pull_request.draft symbols and the ready_for_review event) so draft PR pushes no longer trigger Claude runs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/claude-code-review.yml:
- Around line 4-5: The workflow currently triggers on pull_request types
[opened, synchronize, ready_for_review, reopened], which causes reviews to run
for draft PR pushes; update the pull_request trigger so opened/synchronize do
not fire for drafts — either remove opened and synchronize and rely on
ready_for_review/reopened, or keep them but add a guard that checks
github.event.pull_request.draft == false before running the job (referencing the
pull_request/types and github.event.pull_request.draft symbols and the
ready_for_review event) so draft PR pushes no longer trigger Claude runs.
|
✅ Review app for PR #698 was successfully deleted |
Summary
claude-code-review.ymlworkflow to use the built-in review instead of the broken plugin approachgh apivia the Bash tool, which the action's sandbox blocksplugin_marketplaces/plugins/promptwithreview_triggered_on: pranduse_sticky_comment: trueTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit