Skip to content

Commit b99b2dc

Browse files
authored
Merge pull request #415 from DialmasterOrg/feat/claude-code-pr-reviews
ci: add Claude Code review workflow for PRs
2 parents 4b99145 + cb9a074 commit b99b2dc

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/claude.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Claude Code Review
2+
3+
permissions:
4+
contents: write
5+
pull-requests: write
6+
issues: write
7+
id-token: write
8+
9+
on:
10+
# Automatic review when PRs target dev branch
11+
pull_request:
12+
types: [opened, synchronize]
13+
branches:
14+
- dev
15+
16+
# Manual @claude triggers in comments
17+
issue_comment:
18+
types: [created]
19+
pull_request_review_comment:
20+
types: [created]
21+
22+
jobs:
23+
# Automatic review for PRs targeting dev
24+
auto-review:
25+
if: github.event_name == 'pull_request'
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- uses: anthropics/claude-code-action@v1
31+
with:
32+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
33+
prompt: "/review"
34+
claude_args: "--max-turns 5"
35+
36+
# Manual @claude responses - restricted to authorized users
37+
manual-claude:
38+
if: |
39+
(github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment') &&
40+
contains(github.event.comment.body, '@claude') &&
41+
(
42+
github.event.comment.author_association == 'OWNER' ||
43+
github.event.comment.author_association == 'MEMBER' ||
44+
github.event.comment.author_association == 'COLLABORATOR'
45+
)
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
50+
- uses: anthropics/claude-code-action@v1
51+
with:
52+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
53+
claude_args: "--max-turns 10"

0 commit comments

Comments
 (0)