Add Claude Code GitHub Workflow - #167
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds a new GitHub Actions workflow for automated Claude code reviews and updates an existing Claude workflow to use Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant PR as "GitHub PR (event)"
participant Runner as "GitHub Actions Runner"
participant Repo as "Repository (checkout)"
participant Claude as "anthropics/claude-code-action@v1"
participant GH_API as "GitHub API (gh CLI)"
Note over PR,Runner: Trigger on PR opened / synchronized
PR->>Runner: webhook triggers workflow
Runner->>Repo: checkout code (actions/checkout)
Runner->>Claude: run Claude action with PR metadata + prompt\n(claims token via claude_code_oauth_token)
Claude->>Claude: analyze diff, repo files, tests
Claude->>GH_API: post review comment using gh commands (via enabled claude_args)
GH_API->>PR: comment on PR with findings
Note over GH_API,PR: workflow ends
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 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 |
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/claude.yml (1)
1-1: Fix Prettier formatting issues.The CI pipeline has detected formatting issues in this file. Run
prettier --write .github/workflows/claude.ymlto fix them before merging.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/claude-code-review.yml.github/workflows/claude.yml
🧰 Additional context used
📓 Path-based instructions (1)
.github/workflows/claude.yml
📄 CodeRabbit inference engine (CLAUDE.md)
Trigger automatic AI assistance on @claude mentions in issues, PRs, and comments using .github/workflows/claude.yml
Files:
.github/workflows/claude.yml
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T03:45:17.253Z
Learning: Applies to .github/workflows/claude.yml : Trigger automatic AI assistance on claude mentions in issues, PRs, and comments using .github/workflows/claude.yml
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T03:45:17.253Z
Learning: Applies to .github/workflows/update-libraries.yml : Execute npm run update:libs on schedule and open pull requests when dependencies or Codex/Claude tooling changes in .github/workflows/update-libraries.yml
Learnt from: CR
Repo: keito4/config PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-09T08:39:14.049Z
Learning: Follow development quality standards defined in `CLAUDE.md` when using Claude Code for development assistance
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T03:45:17.253Z
Learning: Applies to .github/workflows/ci.yml : Validate code quality in CI pipeline (.github/workflows/ci.yml) with linting, formatting, testing, and building
📚 Learning: 2025-12-01T03:45:17.253Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T03:45:17.253Z
Learning: Applies to .github/workflows/claude.yml : Trigger automatic AI assistance on claude mentions in issues, PRs, and comments using .github/workflows/claude.yml
Applied to files:
.github/workflows/claude.yml.github/workflows/claude-code-review.yml
📚 Learning: 2025-12-01T03:45:17.253Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T03:45:17.253Z
Learning: Applies to .github/workflows/update-libraries.yml : Execute npm run update:libs on schedule and open pull requests when dependencies or Codex/Claude tooling changes in .github/workflows/update-libraries.yml
Applied to files:
.github/workflows/claude.yml.github/workflows/claude-code-review.yml
📚 Learning: 2025-12-09T08:39:14.049Z
Learnt from: CR
Repo: keito4/config PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-09T08:39:14.049Z
Learning: Follow development quality standards defined in `CLAUDE.md` when using Claude Code for development assistance
Applied to files:
.github/workflows/claude.yml.github/workflows/claude-code-review.yml
📚 Learning: 2025-12-01T03:45:17.253Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T03:45:17.253Z
Learning: Applies to .github/workflows/ci.yml : Validate code quality in CI pipeline (.github/workflows/ci.yml) with linting, formatting, testing, and building
Applied to files:
.github/workflows/claude-code-review.yml
🪛 GitHub Actions: CI
.github/workflows/claude.yml
[warning] 1-1: Prettier formatting issues detected in this file. Run 'prettier --write' to fix.
.github/workflows/claude-code-review.yml
[warning] 1-1: Prettier formatting issues detected in this file. Run 'prettier --write' to fix.
🔇 Additional comments (5)
.github/workflows/claude-code-review.yml (3)
21-26: LGTM!Permissions are appropriately scoped for a read-only review workflow. The
id-token: writepermission enables OIDC authentication with the Claude Code action.
28-32: LGTM!Using
fetch-depth: 1is appropriate for code review workflows, optimizing checkout performance while providing all necessary context.
34-56: LGTM! Good alignment with repository standards.The step configuration properly uses the v1 action with OAuth token authentication. The prompt correctly references CLAUDE.md for guidance on style and conventions, which aligns with the repository's development quality standards. The allowed-tools configuration appropriately restricts Claude to read-only gh commands plus
gh pr commentfor providing feedback.Based on learnings, CLAUDE.md defines development quality standards that should be followed.
.github/workflows/claude.yml (2)
21-26: LGTM! Improved security posture.Moving permissions from global scope to job level is a security best practice, providing explicit and minimal permissions. The
actions: readpermission is appropriately documented and enables Claude to access CI results on PRs.
33-49: LGTM! Proper migration to v1 action.The changes correctly migrate from the beta version to v1:
- Unified OAuth token authentication replaces separate API key and GitHub token
- Added explicit step id for better workflow observability
- The
additional_permissionsblock properly grants Claude access to CI resultsThe commented
claude_argsexample provides helpful guidance for future customization with explicit tool restrictions if needed.Ensure the
CLAUDE_CODE_OAUTH_TOKENsecret is configured in the repository settings. This secret replaces the previousANTHROPIC_API_KEYandGITHUB_TOKENconfiguration and is required for the v1 action to function.
|
🎉 This PR is included in version 1.4.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🤖 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
✏️ Tip: You can customize this high-level summary in your review settings.