Add Claude Code GitHub Workflow - #106
Conversation
WalkthroughTwo GitHub Actions workflow files were updated. A new workflow, "Claude Code Review," was added to automate code review on pull requests using the Claude action. The existing workflow was renamed to "Claude Code," with updated triggers, job naming, conditional logic, permissions, and expanded configuration options for the Claude action. Changes
Sequence Diagram(s)sequenceDiagram
participant GitHub
participant Claude Code Review Workflow
participant Claude Action
GitHub->>Claude Code Review Workflow: PR opened/synchronized event
Claude Code Review Workflow->>Claude Action: Checkout code & run review
Claude Action->>GitHub: Post AI-generated code review comments
sequenceDiagram
participant GitHub
participant Claude Code Workflow
participant Claude Action
GitHub->>Claude Code Workflow: Issue/PR/comment event with "@claude"
Claude Code Workflow->>Claude Action: Checkout code & process request
Claude Action->>GitHub: Post response or take configured action
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Claude finished @logbie's task —— View job Code Review for Claude Code GitHub WorkflowsTodo List:
Initial AnalysisContext: This PR adds Claude Code integration to the WFL (WebFirst Language) project, a Rust-based natural language programming language. The repository has comprehensive development guidelines emphasizing backward compatibility, testing, and code quality. Files Changed:
✅ Positive Aspects
🔍 Detailed Review
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (5)
.github/workflows/claude.yml (3)
9-12: Consider dropping theassignedissue triggerThe job only runs when the payload contains “@claude”.
For anissues.assignedevent, that text will rarely be present, so the additional trigger generates pointless webhook traffic.- issues: - types: [opened, assigned] + issues: + types: [opened] # remove “assigned” unless you have a use-case
21-26: Duplicateactions: readpermission is unnecessary
actions: readis already granted here but is also passed again via
additional_permissions. One definition is enough; keeping both clutters the file.- id-token: write - actions: read # Required for Claude to read CI results on PRs + id-token: write
40-64: Clean up trailing whitespace to satisfy YAML lintSeveral commented lines contain extra spaces, flagged by YAML-lint.
Removing them eliminates CI noise without changing behaviour.- # model: "claude-opus-4-20250514"␠ + # model: "claude-opus-4-20250514"(Apply similarly on lines 42, 48, 51, 54, 60.)
.github/workflows/claude-code-review.yml (2)
29-32: Fetch full history for more accurate diffsFor code-review jobs it is often useful to have the merge base.
Fetching depth 0 keeps history shallow only when the repo is tiny.- with: - fetch-depth: 1 + with: + fetch-depth: 0
42-51: YAML-lint: remove trailing whitespaceTrailing spaces on commented lines (42, 51, 56, 64, 67, 70, 73) trigger lint errors.
Strip them to keep the workflow lint-clean.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/claude-code-review.yml(1 hunks).github/workflows/claude.yml(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/claude-code-review.yml
[error] 20-20: trailing spaces
(trailing-spaces)
[error] 27-27: trailing spaces
(trailing-spaces)
[error] 42-42: trailing spaces
(trailing-spaces)
[error] 51-51: trailing spaces
(trailing-spaces)
[error] 56-56: trailing spaces
(trailing-spaces)
[error] 64-64: trailing spaces
(trailing-spaces)
[error] 67-67: trailing spaces
(trailing-spaces)
[error] 70-70: trailing spaces
(trailing-spaces)
[error] 73-73: trailing spaces
(trailing-spaces)
[warning] 78-78: too many blank lines (1 > 0)
(empty-lines)
.github/workflows/claude.yml
[error] 42-42: trailing spaces
(trailing-spaces)
[error] 45-45: trailing spaces
(trailing-spaces)
[error] 48-48: trailing spaces
(trailing-spaces)
[error] 51-51: trailing spaces
(trailing-spaces)
[error] 54-54: trailing spaces
(trailing-spaces)
[error] 60-60: trailing spaces
(trailing-spaces)
[warning] 64-64: too many blank lines (1 > 0)
(empty-lines)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build, Test, Clippy
🔇 Additional comments (2)
.github/workflows/claude.yml (1)
34-38: Verify secret naming and scopeThe workflow expects a secret named
CLAUDE_CODE_OAUTH_TOKEN.
Make sure this PAT exists in the repository/org secrets and has at leastreposcope so the action can create comments/commits..github/workflows/claude-code-review.yml (1)
21-26:pull-requests/issuespermissions are read-onlyIf the action relies solely on the OAuth token for writing comments this is fine.
If not, bump towriteto avoid runtime failures:- pull-requests: read - issues: read + pull-requests: write + issues: writePlease confirm which mode the action uses.
🤖 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