Conversation
📝 WalkthroughWalkthroughTwo new GitHub Actions workflows are introduced to integrate Claude AI for automated code analysis. Both workflows trigger on PR and issue events, configure repository permissions, check out the repository, and execute the Claude Code action with authentication tokens. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2304 +/- ##
=======================================
Coverage 35.37% 35.37%
=======================================
Files 18 18
Lines 851 851
=======================================
Hits 301 301
Misses 511 511
Partials 39 39 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds GitHub Actions workflows to integrate Anthropic Claude Code into the repository for interactive “@claude” requests and automated PR code review runs.
Changes:
- Add an on-demand Claude workflow triggered by
@claudein issue/PR comments and reviews. - Add an automatic “Claude Code Review” workflow that runs on PR open/sync events using the code-review plugin.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
.github/workflows/claude.yml |
New workflow to run Claude Code when @claude is mentioned in supported event payloads. |
.github/workflows/claude-code-review.yml |
New workflow to run automated Claude-based code review on PR lifecycle events. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| actions: read # Required for Claude to read CI results on PRs | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
actions/checkout@v4 is inconsistent with the rest of the repo’s workflows, which use actions/checkout@v6 (e.g. .github/workflows/tests.yml, release.yml, codeql-analysis.yml). Aligning versions reduces maintenance overhead and avoids missing newer security/feature updates.
| uses: actions/checkout@v4 | |
| uses: actions/checkout@v6 |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
.github/workflows/claude.yml (1)
8-9:issues: assignedtriggers on every reassignment if issue contains@claudeWhen an issue is reassigned, the
assignedtype fires this workflow. If the issue title or body contains@claude, the condition on line 19 passes and the workflow runs again. This means reassigning the same issue multiple times creates multiple workflow executions.Suggested change
issues: - types: [opened, assigned] + types: [opened]If
assignedevents are intentional, no change is needed. Otherwise, removing it confines issue-based triggers to newly opened issues only.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/claude.yml around lines 8 - 9, The workflow triggers include "issues: types: [opened, assigned]" which causes reruns on reassignment; to fix, change the trigger to only "issues: types: [opened]" or keep "assigned" but add a guard that checks the event action (e.g., require github.event.action == 'opened') or tighten the condition that looks for "@claude" so it only runs for newly opened issues; update the "issues: types" array or the workflow if-condition accordingly to prevent repeats.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/claude-code-review.yml:
- Around line 29-30: Replace floating action tags with immutable commit SHAs:
locate all "uses:" entries such as "uses: actions/checkout@v4" and the "uses:
anthropics/claude-code-action@..." reference in the workflow and replace the tag
form with the corresponding pinned full commit SHA for each action (obtain SHAs
from the action repositories' releases/tags). Ensure every third-party action
used in the file is updated to its full commit SHA so the workflow no longer
references floating tags.
- Around line 22-25: Update the workflow permissions block so the
anthropics/claude-code-action can post PR review comments: change the three
permission entries "contents", "pull-requests", and "issues" from "read" to
"write" in the permissions section (symbol names: permissions, contents,
pull-requests, issues) and ensure the action invocation referencing
anthropics/claude-code-action will run with those elevated scopes; remember that
PRs from forks still require a GitHub App installation token rather than
GITHUB_TOKEN if you need cross-repo write access.
In @.github/workflows/claude.yml:
- Around line 21-26: The workflow's permissions block grants read-only access
for contents, pull-requests, and issues which prevents the
anthropics/claude-code-action from posting comments or updating PRs; update the
permissions keys (contents, pull-requests, issues) to include write access so
the Claude action can perform interactive operations, and remove the redundant
actions: read entry in additional_permissions to avoid duplication (ensure
actions remains the intended value once consolidated).
---
Nitpick comments:
In @.github/workflows/claude.yml:
- Around line 8-9: The workflow triggers include "issues: types: [opened,
assigned]" which causes reruns on reassignment; to fix, change the trigger to
only "issues: types: [opened]" or keep "assigned" but add a guard that checks
the event action (e.g., require github.event.action == 'opened') or tighten the
condition that looks for "@claude" so it only runs for newly opened issues;
update the "issues: types" array or the workflow if-condition accordingly to
prevent repeats.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: fe2e6a27-c9e5-4c68-a4e5-1fd56fd5dbca
📒 Files selected for processing (2)
.github/workflows/claude-code-review.yml.github/workflows/claude.yml
🤖 Installing Claude Code GitHub App
This PR adds a GitHub Actions workflow that enables Claude Code integration in our repository.
What is Claude Code?
Claude Code is an AI coding agent that can help with:
How it works
Once this PR is merged, we'll be able to interact with Claude by mentioning @claude in a pull request or issue comment.
Once the workflow is triggered, Claude will analyze the comment and surrounding context, and execute on the request in a GitHub action.
Important Notes
Security
There's more information in the Claude Code action repo.
After merging this PR, let's try mentioning @claude in a comment on any PR to get started!
Summary by CodeRabbit