Skip to content

Commit 842b2bc

Browse files
committed
Restrict Claude workflows to OWNER only
1 parent 7e5cf2f commit 842b2bc

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@ on:
1212

1313
jobs:
1414
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-
15+
if: github.event.pull_request.author_association == 'OWNER'
2116
runs-on: ubuntu-latest
2217
permissions:
2318
contents: read

.github/workflows/claude.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ 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.comment.author_association == 'OWNER' ||
17+
github.event.issue.author_association == 'OWNER' ||
18+
github.event.review.user.login == github.repository_owner) &&
19+
((github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
20+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
21+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
22+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))))
2023
runs-on: ubuntu-latest
2124
permissions:
2225
contents: read

0 commit comments

Comments
 (0)