Skip to content

Commit a6eaa30

Browse files
committed
chore: rename mention to comment workflow and add @claude/review trigger
1 parent 552da0d commit a6eaa30

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: mention
1+
name: comment
22

33
on:
44
issue_comment:
@@ -13,13 +13,13 @@ on:
1313
jobs:
1414
comment:
1515
if: |
16-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) ||
16+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude ') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) ||
1717
(github.event_name == 'issues' && (
18-
(contains(github.event.issue.body, '@claude') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.issue.author_association)) ||
18+
(contains(github.event.issue.body, '@claude ') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.issue.author_association)) ||
1919
(github.event.action == 'assigned' && github.event.assignee.login == 'claude[bot]')
2020
)) ||
21-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) ||
22-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.review.author_association))
21+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude ') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) ||
22+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude ') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.review.author_association))
2323
runs-on: ubuntu-latest
2424
permissions:
2525
contents: write
@@ -32,7 +32,7 @@ jobs:
3232
with:
3333
fetch-depth: 1
3434

35-
- name: React on Mention
35+
- name: React on Comment
3636
uses: anthropics/claude-code-action@57ab6717ca1d3d137264d60c630870bd3b903729 # v1.0.92
3737
with:
3838
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

.github/workflows/review.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ name: review
33
on:
44
pull_request:
55
types: [opened, synchronize, ready_for_review, reopened]
6+
issue_comment:
7+
types: [created]
68

79
jobs:
810
pull-request:
11+
if: |
12+
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) ||
13+
(github.event_name == 'issue_comment' && github.event.issue.pull_request != null && contains(github.event.comment.body, '@claude/review') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association))
914
runs-on: ubuntu-latest
10-
1115
permissions:
1216
actions: read
1317
contents: read
@@ -19,6 +23,7 @@ jobs:
1923
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2024
with:
2125
fetch-depth: 1
26+
ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/merge', github.event.issue.number) || '' }}
2227

2328
- name: Review Changes
2429
uses: anthropics/claude-code-action@57ab6717ca1d3d137264d60c630870bd3b903729 # v1.0.92
@@ -28,7 +33,7 @@ jobs:
2833
track_progress: true
2934
prompt: |
3035
REPO: ${{ github.repository }}
31-
PR NUMBER: ${{ github.event.pull_request.number }}
36+
PR NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }}
3237
3338
Perform a comprehensive review of this pull request.
3439

0 commit comments

Comments
 (0)