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: