-
Notifications
You must be signed in to change notification settings - Fork 54
63 lines (57 loc) · 2.2 KB
/
claude-code-review.yml
File metadata and controls
63 lines (57 loc) · 2.2 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
name: Claude Code Review
on:
pull_request:
types: [opened, synchronize]
paths: # Only run on specific file changes
- "src/**/*.cr"
- "static/**/*.js"
workflow_dispatch:
inputs:
pr_number:
description: 'PR number to review'
required: true
type: string
jobs:
claude-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: read
id-token: write
actions: read # Required for Claude to read CI results on PRs
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref || github.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: |
REPO: ${{ github.repository }}
PR_NUMBER: ${{ inputs.pr_number || github.event.pull_request.number }}
Review this PR and report ONLY problems that need fixing.
You have a maximum of 15 turns — finish well within that limit.
Steps:
1. Run `gh pr diff` to read the changes
2. Analyze the diff. Only use Read/Glob/Grep if the diff alone is insufficient to understand a change.
3. Post findings with `gh pr comment --edit-last` (to update any previous review), or `gh pr comment` if no previous comment exists.
Report only:
- Bugs and logic errors
- Security vulnerabilities
- Performance issues (especially allocations in hot paths)
- Missing error handling
- Crystal anti-patterns
If no problems found, say "No issues found."
Do NOT:
- Check CI status or previous commits
- Run specs
- Use emojis
- Explore the codebase broadly — only read specific files when needed
claude_args: |
--model claude-opus-4-6
--max-turns 20
--allowedTools "Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Read,Glob,Grep"