@@ -22,18 +22,23 @@ jobs:
2222 outputs :
2323 run_review : ${{ steps.check.outputs.run_review }}
2424 steps :
25- - name : Check for exact @claude review command
25+ - name : Check for @claude review on its own line
2626 id : check
2727 env :
2828 COMMENT_BODY : ${{ github.event.comment.body }}
2929 run : |
30- body ="$(python - <<'PY'
30+ has_review_command ="$(python - <<'PY'
3131 import os
32+
3233 body = os.environ.get("COMMENT_BODY", "")
33- print(" ".join(body.split()))
34+ print(
35+ "true"
36+ if any(line.strip() == "@claude review" for line in body.splitlines())
37+ else "false"
38+ )
3439 PY
3540 )"
36- if [ "$body " = "@claude review " ]; then
41+ if [ "$has_review_command " = "true " ]; then
3742 echo "run_review=true" >> "$GITHUB_OUTPUT"
3843 else
3944 echo "run_review=false" >> "$GITHUB_OUTPUT"
4449 if : |
4550 always() &&
4651 (
47- (github.event_name == 'pull_request' && github.event.pull_request.user.type != 'Bot') ||
52+ (
53+ github.event_name == 'pull_request' &&
54+ github.event.pull_request.user.type != 'Bot' &&
55+ github.event.pull_request.draft == false &&
56+ contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.pull_request.author_association) &&
57+ !contains(github.event.pull_request.labels.*.name, 'skip-ai-review') &&
58+ !contains(github.event.pull_request.labels.*.name, 'dependencies') &&
59+ !contains(github.event.pull_request.labels.*.name, 'chore')
60+ ) ||
4861 needs.detect-claude-command.outputs.run_review == 'true'
4962 )
5063 runs-on :
5366 PR_NUMBER : ${{ github.event.pull_request.number || github.event.issue.number }}
5467 permissions :
5568 contents : read
56- pull-requests : read
69+ pull-requests : write
5770 issues : read
5871 id-token : write
72+ actions : read
5973
6074 steps :
6175 - name : Checkout repository
@@ -65,13 +79,24 @@ jobs:
6579
6680 - name : Run Claude Code Review
6781 id : claude-review
68- uses : anthropics/claude-code-action@v1
82+ uses : anthropics/claude-code-action@88c168b39e7e64da0286d812b6e9fbebb6708185
6983 with :
7084 claude_code_oauth_token : ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
85+ track_progress : >-
86+ ${{
87+ (
88+ github.event_name == 'pull_request' &&
89+ contains(fromJson('["opened","synchronize","ready_for_review","reopened"]'), github.event.action)
90+ ) ||
91+ (
92+ github.event_name == 'issues' &&
93+ contains(fromJson('["opened","edited","labeled","assigned"]'), github.event.action)
94+ )
95+ }}
7196 plugin_marketplaces : ' https://github.com/anthropics/claude-code.git'
7297 plugins : ' code-review@claude-code-plugins'
7398 prompt : ' /code-review:code-review ${{ github.repository }}/pull/${{ env.PR_NUMBER }}'
7499
75100 # Tools based on CLAUDE.md development commands
76101 # Includes: uv (pytest, alembic, python), pnpm (check, lint, test), and gh CLI
77- claude_args : ' --allowed-tools "Bash(uv run pytest:*),Bash(uv run alembic:*),Bash(uv run python:*),Bash(uv sync:*),Bash(pnpm install:*),Bash(pnpm check:*),Bash(pnpm lint:*),Bash(pnpm format:*),Bash(pnpm test:*),Bash(pnpm build:*),Bash(gh issue:*),Bash(gh pr:*),Bash(gh search:*)"'
102+ claude_args : ' --allowed-tools "mcp__github_inline_comment__create_inline_comment, Bash(uv run pytest:*),Bash(uv run alembic:*),Bash(uv run python:*),Bash(uv sync:*),Bash(pnpm install:*),Bash(pnpm check:*),Bash(pnpm lint:*),Bash(pnpm format:*),Bash(pnpm test:*),Bash(pnpm build:*),Bash(gh issue:*),Bash(gh pr:*),Bash(gh search:*)" --model claude-opus-4-6 '
0 commit comments