-
Notifications
You must be signed in to change notification settings - Fork 713
gha: add claude-code-review.yml workflow #29488
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,60 @@ | ||||||||||||||||||||||
| --- | ||||||||||||||||||||||
| name: claude-code-review | ||||||||||||||||||||||
| on: | ||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||
| types: [labeled] | ||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||
| claude-review: | ||||||||||||||||||||||
| if: github.event.label.name == 'claude-review' | ||||||||||||||||||||||
| runs-on: ubuntu-24.04 | ||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Best practice: Consider using
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. next ubuntu release may have breaking changes like |
||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||
| pull-requests: write | ||||||||||||||||||||||
| id-token: write | ||||||||||||||||||||||
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security consideration: The Note: Please verify whether this permission is actually needed by the claude-code-action. |
||||||||||||||||||||||
| actions: read | ||||||||||||||||||||||
| steps: | ||||||||||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||||||||||
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consistency suggestion: Other workflows in this repository use
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| fetch-depth: 1 | ||||||||||||||||||||||
|
||||||||||||||||||||||
| fetch-depth: 1 | |
| fetch-depth: 0 |
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
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.
Potential cleanup: Since persist-credentials: false is set on checkout (line 19) and the claude-code-action likely handles its own git authentication, this gh auth setup-git step may be unnecessary. The action's documentation should clarify whether this step is required.
Consider testing without this step to simplify the workflow.
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
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.
Version pinning suggestion: Using @v1 will automatically get new minor/patch versions, which could introduce unexpected behavior changes. Consider pinning to a specific version (e.g., @v1.0.43 as referenced in the PR description) for more predictable behavior, especially since this is a cost-sensitive workflow.
| - uses: anthropics/claude-code-action@v1 | |
| - uses: anthropics/claude-code-action@v1.0.43 |
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.
this action updates frequently with bug fixes and i trust anthropic's adherence to semver major version so intentionally used float version v1
Copilot
AI
Feb 4, 2026
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.
The empty strings for allowed_bots and allowed_non_write_users suggest restricted access, but this configuration is not documented. Consider adding comments explaining why these are explicitly set to empty strings and what the security implications are.
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | |
| allowed_bots: "" | |
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | |
| # Explicitly disallow any additional bot accounts from being used by this action. | |
| # Leaving this empty ensures only the GitHub Actions bot associated with this workflow | |
| # can perform automated changes, reducing the risk of unintended or spoofed bot activity. | |
| allowed_bots: "" | |
| # Explicitly prevent non-write collaborators from triggering code-modifying reviews. | |
| # This avoids granting users without write access the ability to have Claude propose or | |
| # apply changes with the repository's write permissions, reducing privilege escalation risk. |
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
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.
for reference: this claude-code review took 17 turns
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
andrewhsu marked this conversation as resolved.
Show resolved
Hide resolved
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.
Security consideration: The allowed Bash commands (gh issue *, gh pr *, gh search *) are quite permissive. While these are read operations, some gh pr subcommands can be write operations (e.g., gh pr comment, gh pr edit, gh pr merge).
If the intent is read-only access, consider being more specific:
Bash(gh issue view *)Bash(gh pr view *)Bash(gh pr diff *)Bash(gh search issues *)Bash(gh search prs *)
However, if write access to PRs is intentional (e.g., for posting review comments via gh pr comment), this is acceptable. The PR description mentions Claude will "comment inline" which may utilize these permissions.
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.
intentional to allow comment inline
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.
Enhancement suggestion: The prompt could be more specific to the Redpanda codebase by referencing the CLAUDE.md file guidelines. This would help ensure reviews align with project-specific standards (C++ coding guidelines, naming conventions, Seastar patterns, etc.).
For example, adding a line like:
Follow the coding guidelines documented in CLAUDE.md when reviewing.
This would make the AI reviewer more effective at catching project-specific issues like:
- Missing
ss::namespace prefix for Seastar types - Use of
std::vectorwherechunked_vectorshould be used - Missing
format_tomember functions instead ofoperator<<overloads
Uh oh!
There was an error while loading. Please reload this page.