Skip to content

Commit a930861

Browse files
committed
Add Claude to code reviews
Signed-off-by: Maksym Pavlenko <[email protected]>
1 parent a6a50a5 commit a930861

File tree

2 files changed

+41
-7
lines changed

2 files changed

+41
-7
lines changed

.github/workflows/claude.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Claude Code
1+
name: Claude
22

33
on:
44
issue_comment:
@@ -17,13 +17,15 @@ jobs:
1717
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
1818
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
1919
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20+
2021
runs-on: ubuntu-latest
2122
permissions:
2223
contents: write
2324
pull-requests: write
2425
issues: write
2526
id-token: write
2627
actions: read # Required for Claude to read CI results on PRs
28+
2729
steps:
2830
- name: Checkout repository
2931
uses: actions/checkout@v5
@@ -34,19 +36,13 @@ jobs:
3436
with:
3537
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
3638

37-
# This is an optional setting that allows Claude to read CI results on PRs
3839
additional_permissions: |
3940
actions: read
4041
4142
allowed_tools: "Bash(go:*),Bash(golangci-lint:*),Bash(make:*),View,GlobTool,GrepTool,BatchTool,mcp__github"
4243

43-
# Optional: Add custom instructions for Claude to customize its behavior for your project
4444
custom_instructions: |
4545
Follow our coding standards
4646
Ensure tests and lints pass before making commits or PRs
4747
Run 'make test' to verify all tests pass
4848
Use Go conventions and best practices
49-
When reviewing code: provide brief summary of changes,
50-
list concerns as bullets (keep short and understandable),
51-
end with approval status using red/green icons for visibility.
52-

.github/workflows/review.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
issue_comment:
7+
types: [created]
8+
9+
jobs:
10+
code-review:
11+
if: |
12+
github.event_name == 'pull_request' ||
13+
(github.event_name == 'issue_comment' &&
14+
github.event.issue.pull_request &&
15+
contains(github.event.comment.body, '@claude review'))
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
pull-requests: write
20+
issues: write
21+
id-token: write
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0 # Full history for better diff analysis
27+
28+
- name: Code Review with Claude
29+
uses: anthropics/claude-code-action@beta
30+
with:
31+
mode: experimental-review
32+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
33+
timeout_minutes: "30"
34+
custom_instructions: |
35+
Follow our coding standards
36+
Provide brief summary of changes,
37+
list concerns as bullets (keep short and understandable),
38+
end with approval status using red/green icons for visibility.

0 commit comments

Comments
 (0)