-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (51 loc) · 2.45 KB
/
claude-code-review.yml
File metadata and controls
58 lines (51 loc) · 2.45 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
name: Claude Code Review
on:
# Same-repo branches: full access to secrets and write permissions
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
# Fork PRs: runs in base repo context with secrets access
pull_request_target:
types: [opened, synchronize, ready_for_review, reopened]
jobs:
claude-review:
# Skip owner's own PRs; avoid duplicate runs for same-repo vs fork branches
if: |
github.event.pull_request.user.login != 'neuromechanist' &&
!(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) &&
!(github.event_name == 'pull_request_target' && !github.event.pull_request.head.repo.fork)
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: read
id-token: write
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 1
- name: Review and fix PR
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
additional_permissions: |
actions: read
prompt: |
Review this pull request thoroughly. For each issue found:
1. Classify severity: critical, important, or suggestion
2. For critical and important issues: fix them directly by editing the code and pushing a commit
3. For suggestions that clearly improve code quality and are not false positives: fix them too
4. Skip suggestions that are stylistic preferences or false positives
Project conventions:
- Python 3.12+, managed with uv
- Ruff for linting and formatting (no manual style fixes needed)
- No mock objects that replace business logic; avoid mock classes or mock return values
that bypass real code paths (HTTP response fixtures with respx/pytest-httpx are acceptable)
- Type hints required on new code
- Atomic, focused commits; no AI attribution in commit messages
- Commit messages: concise, <50 chars, no emojis
After making fixes, leave a PR comment summarizing what was found and what was fixed.
If you cannot push to the PR branch (e.g., fork PRs), leave detailed review comments instead.