@@ -3,15 +3,12 @@ name: review
33on :
44 issue_comment :
55 types : [created]
6- pull_request :
7- paths :
8- - .github/workflows/review.yml
9- - .claude/commands/pr-review.md
10- - dev/mcps/review.py
6+ pull_request_target :
7+ types : [opened, ready_for_review]
118
129concurrency :
13- group : ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
14- cancel-in-progress : ${{ github.event_name == 'pull_request' }}
10+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.issue.number }}
11+ cancel-in-progress : true
1512
1613defaults :
1714 run :
@@ -24,15 +21,14 @@ jobs:
2421 pull-requests : write
2522 timeout-minutes : 30
2623 # Security: Only run for authorized users.
27- # - pull_request : Only run for PRs from the upstream repo by authorized users (not forks)
24+ # - pull_request_target : Only run for maintainers
2825 # - issue_comment: BOTH PR author and commenter must be authorized (can't trust external PRs)
26+ # TODO: Remove `github.event.pull_request.user.login == 'harupy'` after testing
2927 if : >
30- (github.event_name == 'pull_request' &&
31- github.event.pull_request.head.repo.full_name == github.repository &&
32- (
33- contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) ||
34- (github.event.pull_request.user.login == 'Copilot' && github.event.pull_request.user.type == 'Bot')
35- ))
28+ (github.event_name == 'pull_request_target' &&
29+ github.event.pull_request.draft == false &&
30+ contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) &&
31+ github.event.pull_request.user.login == 'harupy')
3632 ||
3733 (github.event_name == 'issue_comment' &&
3834 github.event.issue.pull_request &&
@@ -75,18 +71,10 @@ jobs:
7571 throw new Error(`User not allowed to trigger workflow: ${comment.user.login} (association: ${authorAssociation})`);
7672 }
7773 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
78- with :
79- ref : refs/pull/${{ github.event.pull_request.number || github.event.issue.number }}/merge
8074 - uses : astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0
8175 - name : Install Claude CLI
8276 run : |
83- npm install -g @anthropic-ai/claude-code@2.0.24
84-
85- - name : Set up MCP servers
86- env :
87- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
88- run : |
89- claude mcp add review --env "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" -- uv run --no-project dev/mcps/review.py
77+ npm install -g @anthropic-ai/claude-code@2.1.3
9078
9179 - name : Extract optional prompt from comment
9280 if : github.event_name == 'issue_comment'
0 commit comments