File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Claude Code Review
22
33on :
4- pull_request :
4+ # Use pull_request_target so this works for fork PRs and can mint an OIDC token.
5+ # IMPORTANT: do NOT checkout or run fork code in this workflow.
6+ pull_request_target :
57 types : [opened, synchronize, ready_for_review, reopened]
68 # Optional: Only run on specific file changes
79 # paths:
1214
1315jobs :
1416 claude-review :
15- # Optional: Filter by PR author
17+ # Optional: Filter by PR author / association
1618 # if: |
17- # github.event.pull_request.user.login == 'external-contributor' ||
18- # github.event.pull_request.user.login == 'new-developer' ||
19- # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
19+ # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' ||
20+ # github.event.pull_request.author_association == 'CONTRIBUTOR'
2021
2122 runs-on : ubuntu-latest
2223 permissions :
2627 id-token : write
2728
2829 steps :
29- - name : Checkout repository
30- uses : actions/checkout@v4
31- with :
32- fetch-depth : 1
30+ # NOTE: No checkout step on purpose.
31+ # With pull_request_target, checking out PR code from forks can expose secrets.
3332
3433 - name : Run Claude Code Review
3534 id : claude-review
4140 prompt : ' /code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
4241 # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
4342 # or https://code.claude.com/docs/en/cli-reference for available options
44-
Original file line number Diff line number Diff line change @@ -23,28 +23,13 @@ jobs:
2323 pull-requests : write
2424 issues : write
2525 id-token : write
26- actions : read # Required for Claude to read CI results on PRs
27- steps :
28- - name : Checkout repository
29- uses : actions/checkout@v4
30- with :
31- fetch-depth : 1
26+ actions : read
3227
28+ steps :
3329 - name : Run Claude Code
3430 id : claude
3531 uses : anthropics/claude-code-action@v1
3632 with :
3733 claude_code_oauth_token : ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38-
39- # This is an optional setting that allows Claude to read CI results on PRs
4034 additional_permissions : |
4135 actions: read
42-
43- # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
44- # prompt: 'Update the pull request description to include a summary of changes.'
45-
46- # Optional: Add claude_args to customize behavior and configuration
47- # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48- # or https://code.claude.com/docs/en/cli-reference for available options
49- # claude_args: '--allowed-tools Bash(gh pr:*)'
50-
You can’t perform that action at this time.
0 commit comments