-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add Claude Code GitHub Workflow #636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md | ||
| # or https://docs.claude.com/en/docs/claude-code/cli-reference for available options | ||
| claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical: The flag name is incorrect. Should be --allowedTools (camelCase), not --allowed-tools (kebab-case).
This will cause the tool restrictions to be ignored, potentially allowing Claude to use unintended tools or preventing it from using necessary ones.
| claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"' | |
| claude_args: '--allowedTools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"' |
See docs/usage.md and docs/configuration.md for correct syntax.
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important: The prompt instructs Claude to use gh pr comment (line 52), which requires write permissions. Currently only read is granted.
While this may work if the action uses the Claude GitHub App token, it could fail with confusing errors if it uses the workflow token.
Consider either:
- Adding write permission:
pull-requests: write - Or adding a comment explaining the reliance on Claude App authentication
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Performance concern: This workflow runs unconditionally on every PR opened/updated, which could result in high costs in active repositories.
Consider adding path filters or conditional logic:
on:
pull_request:
types: [opened, synchronize]
paths: # Only run on source code changes
- "src/**/*.ts"
- "src/**/*.tsx"
- "src/**/*.js"
- "src/**/*.jsx"Or add a job-level condition:
jobs:
claude-review:
if: |
github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' ||
github.event.pull_request.draft == falseAlso consider adding concurrency controls to cancel older runs:
concurrency:
group: claude-review-${{ github.event.pull_request.number }}
cancel-in-progress: true| # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md | ||
| # or https://docs.claude.com/en/docs/claude-code/cli-reference for available options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider updating the documentation references to point to action-specific docs first:
| # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md | |
| # or https://docs.claude.com/en/docs/claude-code/cli-reference for available options | |
| # See https://github.com/anthropics/claude-code-action/blob/main/docs/configuration.md | |
| # and https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md for available options |
The current link to docs.claude.com may be less specific for GitHub Action usage.
| # Optional: Add claude_args to customize behavior and configuration | ||
| # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md | ||
| # or https://docs.claude.com/en/docs/claude-code/cli-reference for available options | ||
| # claude_args: '--allowed-tools Bash(gh pr:*)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistency issue: The example uses the same incorrect flag name (--allowed-tools instead of --allowedTools).
| # claude_args: '--allowed-tools Bash(gh pr:*)' | |
| # claude_args: '--allowedTools Bash(gh pr:*)' |
This ensures developers copying this example use the correct syntax.
Code Review SummaryI have completed a comprehensive review of this PR using specialized analysis agents. Here are the key findings: Critical Issues
RecommendationsMust Fix:
Should Consider:
Positive Aspects
Test CoverageThe underlying action has excellent test coverage with 26+ test files. GitHub Actions workflows typically do not require unit tests, which is standard practice. See inline comments for specific fixes and suggestions. |
🤖 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!