Add Claude Code GitHub Workflow#19
Conversation
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
|
Caution Review failedThe pull request is closed. WalkthroughTwo GitHub Actions workflows are added to automate Claude code review. The first runs on pull requests to provide automatic code review feedback. The second triggers on comments and reviews mentioning Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Poem
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (2)
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.
Important
Looks good to me! 👍
Reviewed everything up to da1562e in 1 minute and 4 seconds. Click for details.
- Reviewed
119lines of code in2files - Skipped
0files when reviewing. - Skipped posting
3draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/claude-code-review.yml:3
- Draft comment:
Consider adding 'reopened' to the pull_request event types (e.g., [opened, reopened, synchronize]) to ensure that reviews are triggered when a PR is reopened. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
2. .github/workflows/claude.yml:15
- Draft comment:
The condition for detecting '@claude' mentions is case sensitive. Consider normalizing the case or documenting this requirement if users might use different casings. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
3. .github/workflows/claude.yml:40
- Draft comment:
Verify the format of 'additional_permissions'. If a YAML mapping is intended instead of a multi-line string, consider using proper YAML mapping syntax to avoid potential parsing issues. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
Workflow ID: wflow_uoEoTj66Qk1WgV0g
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
Pull request overview
This PR adds GitHub Actions workflows to enable Claude Code integration in the repository. Claude Code is an AI coding agent that can be triggered by mentioning @claude in PR or issue comments to help with bug fixes, documentation, code reviews, and more.
Key Changes:
- Added main Claude Code workflow (
.github/workflows/claude.yml) that responds to @claude mentions in comments - Added automatic PR review workflow (
.github/workflows/claude-code-review.yml) that runs Claude Code review on all new or updated PRs
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
.github/workflows/claude.yml |
Defines workflow triggered by @claude mentions in issues and PRs, integrating Claude Code action with basic read permissions |
.github/workflows/claude-code-review.yml |
Configures automatic Claude Code reviews on PR open/sync events with custom review prompts and limited bash tool access |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| contents: read | ||
| pull-requests: read | ||
| issues: read |
There was a problem hiding this comment.
The permissions are missing pull-requests: write, issues: write, and contents: write which are required for Claude to perform actions like creating comments, branches, and commits as mentioned in the PR description. Without write permissions, Claude will only be able to read but not interact with the repository.
| contents: read | |
| pull-requests: read | |
| issues: read | |
| contents: write | |
| pull-requests: write | |
| issues: write |
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read |
There was a problem hiding this comment.
The permissions are missing pull-requests: write which is required for Claude to comment on the PR using gh pr comment as specified in the prompt on line 52. Without write permissions to pull-requests, the workflow will fail when attempting to post the review comment.
| pull-requests: read | |
| pull-requests: write |
| - Security concerns | ||
| - Test coverage | ||
|
|
||
| Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback. |
There was a problem hiding this comment.
The prompt references "the repository's CLAUDE.md" for guidance on style and conventions, but this file is not included in this PR. If this file doesn't exist in the repository, Claude will not have access to any project-specific guidance, which may lead to inconsistent review feedback.
| Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback. | |
| Be constructive and helpful in your feedback. Follow general best practices for code style and conventions. |
| (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || | ||
| (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || | ||
| (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || | ||
| (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) |
There was a problem hiding this comment.
The workflow lacks user permission validation. According to the PR description, "Only users with write access to the repository can trigger the workflow," but there's no check to enforce this. Any user who can comment on issues or PRs (including external contributors) can trigger Claude by mentioning @claude. Consider adding a check like github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'COLLABORATOR' to the conditional.
| (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || | |
| (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || | |
| (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || | |
| (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) | |
| ( | |
| github.event_name == 'issue_comment' && | |
| contains(github.event.comment.body, '@claude') && | |
| (github.event.comment.author_association == 'MEMBER' || | |
| github.event.comment.author_association == 'OWNER' || | |
| github.event.comment.author_association == 'COLLABORATOR') | |
| ) || | |
| ( | |
| github.event_name == 'pull_request_review_comment' && | |
| contains(github.event.comment.body, '@claude') && | |
| (github.event.comment.author_association == 'MEMBER' || | |
| github.event.comment.author_association == 'OWNER' || | |
| github.event.comment.author_association == 'COLLABORATOR') | |
| ) || | |
| ( | |
| github.event_name == 'pull_request_review' && | |
| contains(github.event.review.body, '@claude') && | |
| (github.event.review.user.author_association == 'MEMBER' || | |
| github.event.review.user.author_association == 'OWNER' || | |
| github.event.review.user.author_association == 'COLLABORATOR') | |
| ) || | |
| ( | |
| github.event_name == 'issues' && | |
| (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) && | |
| (github.event.issue.user.author_association == 'MEMBER' || | |
| github.event.issue.user.author_association == 'OWNER' || | |
| github.event.issue.user.author_association == 'COLLABORATOR') | |
| ) |
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 |
There was a problem hiding this comment.
Using fetch-depth: 1 (shallow clone) may limit Claude's ability to perform thorough code reviews that require git history or comparing against previous commits. For PR reviews, consider using fetch-depth: 0 or at least fetch-depth: 2 to ensure Claude has access to the base branch and can properly review the changes in context.
| fetch-depth: 1 | |
| fetch-depth: 0 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
| issues: read |
There was a problem hiding this comment.
Allow review job to write PR comments
The review workflow config grants only read permissions on issues and pull-requests, yet the prompt at the bottom instructs Claude to post feedback via gh pr comment. The GitHub CLI relies on the job’s GITHUB_TOKEN, and with read-only scopes it returns Resource not accessible by integration, so the review step will fail to publish any comment even if the analysis succeeds. Consider granting write on issues/pull-requests (or supplying a writable token) so the workflow can deliver the review it generates.
Useful? React with 👍 / 👎.
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
| issues: read |
There was a problem hiding this comment.
General Claude job cannot reply to mentions
The main Claude workflow is triggered by @claude mentions but the job permissions are limited to read-only for issues and pull-requests. Any attempt by the action to acknowledge the request (e.g., post a comment or push a change) using the workflow GITHUB_TOKEN will be rejected for lack of write scope, effectively preventing Claude from responding to the user request. Granting the necessary write permissions or configuring a writable token is needed for the integration to function.
Useful? React with 👍 / 👎.
🤖 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!
Missive conversation: https://mail.missiveapp.com/#inbox/conversations/8740f9b8-162e-4e72-a927-cf4aee4f0161
Important
Add GitHub Actions workflows to integrate Claude Code for automated code reviews and issue handling.
.github/workflows/claude-code-review.ymlto trigger on pull request events (opened,synchronize)..github/workflows/claude.ymlto trigger on issue comments, pull request review comments, and issues (opened,assigned).claude-code-review.ymlruns on pull request events and can be filtered by author.claude.ymlruns when@claudeis mentioned in comments or issues.ubuntu-latestand requirereadpermissions for contents, pull-requests, and issues.claude.ymlincludesactions: readto access CI results.actions/checkout@v4to checkout the repository.anthropics/claude-code-action@v1to run Claude with specified OAuth token and optional arguments.This description was created by
for da1562e. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.