From 635c245be361e39b86c262b80f32dac9bc5fc22e Mon Sep 17 00:00:00 2001 From: Koert Lichtendonk Date: Mon, 23 Nov 2026 19:01:16 +0100 Subject: [PATCH] Only start @claude runs for owners, members and collaborators --- .github/workflows/claude-review.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/claude-review.yml b/.github/workflows/claude-review.yml index 328a0cb..b5a8120 100644 --- a/.github/workflows/claude-review.yml +++ b/.github/workflows/claude-review.yml @@ -68,9 +68,12 @@ jobs: --disallowedTools "Edit,Write,Bash(git push:*),mcp__github_file_ops" on-request: + # The action also refuses commenters without write access; checking here means their comments don't start a run. if: | - (github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@claude')) || - (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) + contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association) && ( + (github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) + ) runs-on: ubuntu-latest timeout-minutes: 30 permissions: