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-
You can’t perform that action at this time.
0 commit comments