mirror of
https://github.com/Sea-Haven-Industries/.github.git
synced 2026-09-30 09:23:11 +00:00
Change Claude Code review to on-demand via @claude or review request
Replace automatic PR triggers (opened, ready_for_review) with on-demand triggers: @claude mentions in PR comments, inline review comments, and review requests from the 'claude' team.
This commit is contained in:
parent
b1b341afe5
commit
23e8370c5a
1 changed files with 18 additions and 3 deletions
21
.github/workflows/claude-code-review.yaml
vendored
21
.github/workflows/claude-code-review.yaml
vendored
|
|
@ -7,8 +7,12 @@ on:
|
|||
description: Pull request number to review
|
||||
required: true
|
||||
type: string
|
||||
issue_comment:
|
||||
types: [created]
|
||||
pull_request_review_comment:
|
||||
types: [created]
|
||||
pull_request:
|
||||
types: [opened, ready_for_review]
|
||||
types: [review_requested]
|
||||
workflow_call:
|
||||
secrets:
|
||||
anthropic_api_key:
|
||||
|
|
@ -17,11 +21,21 @@ on:
|
|||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
issues: read
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
claude-review:
|
||||
if: github.event.pull_request.draft == false
|
||||
if: >-
|
||||
(github.event_name == 'issue_comment' &&
|
||||
contains(github.event.comment.body, '@claude') &&
|
||||
github.event.issue.pull_request) ||
|
||||
(github.event_name == 'pull_request_review_comment' &&
|
||||
contains(github.event.comment.body, '@claude')) ||
|
||||
(github.event_name == 'pull_request' &&
|
||||
github.event.requested_team.slug == 'claude') ||
|
||||
github.event_name == 'workflow_dispatch' ||
|
||||
github.event_name == 'workflow_call'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
|
|
@ -33,9 +47,10 @@ jobs:
|
|||
with:
|
||||
anthropic_api_key: ${{ secrets.anthropic_api_key || secrets.ANTHROPIC_API_KEY }}
|
||||
allowed_bots: '*'
|
||||
trigger_phrase: '@claude'
|
||||
prompt: |
|
||||
REPO: ${{ github.repository }}
|
||||
PR NUMBER: ${{ github.event.pull_request.number || github.event.inputs.pr_number }}
|
||||
PR NUMBER: ${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }}
|
||||
|
||||
Review this pull request. Only comment on:
|
||||
- Bugs or logic errors
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue