Add Claude Code GitHub Actions for PR reviews (#4595)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
17
.github/workflows/claude-code-review.yml
vendored
17
.github/workflows/claude-code-review.yml
vendored
@@ -2,19 +2,14 @@ name: Claude Code Review
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, ready_for_review, reopened]
|
types: [opened, synchronize, ready_for_review, reopened]
|
||||||
# Optional: Only run on specific file changes
|
|
||||||
# paths:
|
|
||||||
# - "src/**/*.ts"
|
|
||||||
# - "src/**/*.tsx"
|
|
||||||
# - "src/**/*.js"
|
|
||||||
# - "src/**/*.jsx"
|
|
||||||
jobs:
|
jobs:
|
||||||
claude-review:
|
claude-review:
|
||||||
# Optional: Filter by PR author
|
# Only auto-review PRs from external contributors (not maintainers)
|
||||||
# if: |
|
# This helps community contributors get quick feedback while saving costs
|
||||||
# github.event.pull_request.user.login == 'external-contributor' ||
|
if: |
|
||||||
# github.event.pull_request.user.login == 'new-developer' ||
|
github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' ||
|
||||||
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
|
github.event.pull_request.author_association == 'FIRST_TIMER' ||
|
||||||
|
github.event.pull_request.author_association == 'NONE'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
20
.github/workflows/claude.yml
vendored
20
.github/workflows/claude.yml
vendored
@@ -4,17 +4,25 @@ on:
|
|||||||
types: [created]
|
types: [created]
|
||||||
pull_request_review_comment:
|
pull_request_review_comment:
|
||||||
types: [created]
|
types: [created]
|
||||||
issues:
|
|
||||||
types: [opened, assigned]
|
|
||||||
pull_request_review:
|
pull_request_review:
|
||||||
types: [submitted]
|
types: [submitted]
|
||||||
jobs:
|
jobs:
|
||||||
claude:
|
claude:
|
||||||
|
# Only allow @claude mentions from repository collaborators (not from issue/PR authors who may be external)
|
||||||
if: |
|
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 == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
|
||||||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
|
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
|
||||||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@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
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
Reference in New Issue
Block a user