Skip to content

Commit 47cb88c

Browse files
committed
Address review comments on Claude Code GitHub workflows
- Restrict `claude-code-review.yml` to run only when the `claude` label is added to a PR - Restrict `claude.yml` to trigger only for users with write access (owner/member/collaborator) - Update `actions/checkout` from v4 to v6 in both workflows
1 parent 23de1e0 commit 47cb88c

2 files changed

Lines changed: 8 additions & 19 deletions

File tree

.github/workflows/claude-code-review.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,11 @@ name: Claude Code Review
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, ready_for_review, reopened]
6-
# Optional: Only run on specific file changes
7-
# paths:
8-
# - "src/**/*.ts"
9-
# - "src/**/*.tsx"
10-
# - "src/**/*.js"
11-
# - "src/**/*.jsx"
5+
types: [labeled]
126

137
jobs:
148
claude-review:
15-
# Optional: Filter by PR author
16-
# 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'
20-
9+
if: github.event.label.name == 'claude'
2110
runs-on: ubuntu-latest
2211
permissions:
2312
contents: read
@@ -27,7 +16,7 @@ jobs:
2716

2817
steps:
2918
- name: Checkout repository
30-
uses: actions/checkout@v4
19+
uses: actions/checkout@v6
3120
with:
3221
fetch-depth: 1
3322

.github/workflows/claude.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ on:
1313
jobs:
1414
claude:
1515
if: |
16-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
16+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude') && (github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR')) ||
17+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude') && (github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR')) ||
18+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude') && (github.event.review.author_association == 'OWNER' || github.event.review.author_association == 'MEMBER' || github.event.review.author_association == 'COLLABORATOR')) ||
19+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) && (github.event.issue.author_association == 'OWNER' || github.event.issue.author_association == 'MEMBER' || github.event.issue.author_association == 'COLLABORATOR'))
2020
runs-on: ubuntu-latest
2121
permissions:
2222
contents: read
@@ -26,7 +26,7 @@ jobs:
2626
actions: read # Required for Claude to read CI results on PRs
2727
steps:
2828
- name: Checkout repository
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v6
3030
with:
3131
fetch-depth: 1
3232

0 commit comments

Comments
 (0)