-
-
Notifications
You must be signed in to change notification settings - Fork 31
71 lines (60 loc) · 2.32 KB
/
claude.yml
File metadata and controls
71 lines (60 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Claude Code Review
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
on:
# Automatic review when PRs target dev branch
pull_request:
types: [opened, synchronize]
branches:
- dev
# Manual @claude triggers in comments
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
# Automatic review for PRs targeting dev
auto-review:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}
PR TITLE: ${{ github.event.pull_request.title }}
Please review this pull request with a focus on:
- Code quality and best practices
- Potential bugs or issues
- Security implications
- Performance considerations
Use `gh pr diff ${{ github.event.pull_request.number }}` to see the changes.
IMPORTANT: Only use `gh` commands. Do NOT run tests, npm commands, or any other shell commands.
Post your review as a comment on the PR using `gh pr comment ${{ github.event.pull_request.number }} --body "your review here"`.
Only post GitHub comments - don't just output text.
claude_args: '--max-turns 20 --allowedTools "Bash(gh:*)" "Bash(git fetch *)"'
# Manual @claude responses - restricted to authorized users
manual-claude:
if: |
(github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment') &&
contains(github.event.comment.body, '@claude') &&
(
github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR'
)
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
claude_args: '--max-turns 20 --allowedTools "Bash(gh:*)" "Bash(git fetch *)"'