-
Notifications
You must be signed in to change notification settings - Fork 258
78 lines (65 loc) · 3.06 KB
/
claude-code-review.yml
File metadata and controls
78 lines (65 loc) · 3.06 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
72
73
74
75
76
77
78
name: Claude Code Review
on:
pull_request_target:
types: [opened, ready_for_review]
# Optional: Only run on specific file changes
# paths:
# - "src/**/*.cpp"
# - "src/**/*.h"
# - "src/**/*.py"
jobs:
claude-review:
# Optional: Filter by PR author
# if: |
# github.event.pull_request.user.login == 'external-contributor' ||
# github.event.pull_request.user.login == 'new-developer' ||
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
allowed_non_write_users: '*'
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}
Review this pull request for issues while following code guidelines available at: https://github.com/xbmc/xbmc/blob/master/docs/CODE_GUIDELINES.md
Be extremely concise.
Check for:
- Bugs, crashes, undefined behavior
- Memory leaks, resource management issues
- Thread safety problems
- Security vulnerabilities
- Performance issues
- Logic errors
- Code style violations
Format (issues only):
**Severity** (Critical/Must Fix/Medium/Low/Minor)
**Issue title** (file:line)
Brief description of problem. Suggested fix with reasoning if needed (2-3 lines max).
Rules:
- NO positive feedback, NO "looks good", NO summary sections
- Keep each issue brief but clear
- Use inline comments for code-specific issues
- Skip severity sections if empty
Note: The PR branch is already checked out in the current working directory.
After your review:
1. If you found issues: Use `gh pr comment` for top-level summary, and `mcp__github_inline_comment__create_inline_comment` to highlight specific code issues
2. If everything looks good: Use `gh pr review --approve` with NO message (just the approval checkmark)
# 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: |
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr review:*),Bash(gh pr diff:*),Bash(gh pr view:*)"