Skip to content

Commit f18775a

Browse files
authored
Merge pull request #1270 from modelcontextprotocol/tighten-claude-workflow
ci: gate claude.yml on author_association to skip unauthorized invokes
2 parents adfcccc + 1bbf53c commit f18775a

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

.github/workflows/claude.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,18 @@ jobs:
1414
claude:
1515
if: |
1616
(
17-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
18-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
19-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
20-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
17+
(github.event_name == 'issue_comment' &&
18+
contains(github.event.comment.body, '@claude') &&
19+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) ||
20+
(github.event_name == 'pull_request_review_comment' &&
21+
contains(github.event.comment.body, '@claude') &&
22+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) ||
23+
(github.event_name == 'pull_request_review' &&
24+
contains(github.event.review.body, '@claude') &&
25+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.review.author_association)) ||
26+
(github.event_name == 'issues' &&
27+
(contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) &&
28+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.issue.author_association))
2129
)
2230
runs-on: ubuntu-latest
2331
permissions:

0 commit comments

Comments
 (0)