Add Claude Code GitHub Actions for PR reviews (#4595)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Suchintan
2026-02-02 20:04:09 -05:00
committed by GitHub
parent 9108481f82
commit ae81b19669
2 changed files with 20 additions and 17 deletions

View File

@@ -4,17 +4,25 @@ on:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
# Only allow @claude mentions from repository collaborators (not from issue/PR authors who may be external)
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
(
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude'))
) && (
github.event.sender.type == 'Bot' ||
github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR' ||
github.event.review.author_association == 'OWNER' ||
github.event.review.author_association == 'MEMBER' ||
github.event.review.author_association == 'COLLABORATOR'
)
runs-on: ubuntu-latest
permissions:
contents: read