-
Notifications
You must be signed in to change notification settings - Fork 144
88 lines (78 loc) · 3.1 KB
/
Copy pathclaude-code-review.yml
File metadata and controls
88 lines (78 loc) · 3.1 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
79
80
81
82
83
84
85
86
87
name: Claude Code Review
on:
pull_request:
types: [opened, edited, synchronize, ready_for_review, reopened]
paths:
- "**/*.js"
- "**/*.jsx"
- "**/*.ts"
- "**/*.tsx"
- "**/*.java"
- "**/*.kt"
- "**/*.go"
- "**/*.py"
- "**/*.rs"
- "**/*.sol"
- "**/*.zkasm"
- "**/*.lisp"
- "**/Makefile"
- "**/*.mk"
- "**/Dockerfile"
- "**/Dockerfile.*"
- "**/*.dockerfile"
- "**/*.sh"
- "**/*.bash"
- "**/*.gradle"
- "**/*.gradle.kts"
- "**/gradlew"
- "**/gradle.properties"
- "**/settings.gradle"
- "**/settings.gradle.kts"
jobs:
claude-review:
# Only run when '@claude-review' is present in the PR description
# and the author is a repo owner, member, or collaborator (i.e. team member)
if: |
github.event.pull_request.head.repo.full_name == github.repository &&
contains(github.event.pull_request.body, '@claude-review') &&
(
github.event.pull_request.author_association == 'OWNER' ||
github.event.pull_request.author_association == 'MEMBER' ||
github.event.pull_request.author_association == 'COLLABORATOR'
)
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 1
- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@521136812280ae7ef256e06045655b9da02793f0 #v1.0.158
env:
ANTHROPIC_BASE_URL: ${{ vars.LITELLM_BASE_URL }}
with:
anthropic_api_key: ${{ secrets.LITELLM_KEY_CLAUDE_PR_REVIEW }}
# The pinned action's inline-comment classifier calls api.anthropic.com
# directly, ignoring ANTHROPIC_BASE_URL. Disable it so review traffic
# stays on the LiteLLM-routed Claude Code path.
classify_inline_comments: "false"
# use_sticky_comment: false
direct_prompt: |
You are a senior software engineer performing a thorough code review on PR #${{ github.event.pull_request.number }} in ${{ github.repository }}.
Review ONLY changed files with the following extensions or names:
.js .jsx .ts .tsx .java .kt .go .py .rs .sol .sh .bash .gradle .gradle.kts .mk .dockerfile .zkasm .lisp
Makefile gradlew gradle.properties settings.gradle settings.gradle.kts Dockerfile Dockerfile.*
For each issue you find, post an inline pull request review comment on the exact file and line where the problem occurs.
Focus on:
- Bugs and logic errors
- Security vulnerabilities (injection, unsafe deserialization, improper auth, etc.)
- Performance problems
- Code quality, readability, and maintainability issues
- Incorrect or missing error handling
Be specific, actionable, and constructive. Do NOT post a general top-level PR summary comment.