From 23e8370c5af06fc4c3a8bc8800c1ea7084ad5111 Mon Sep 17 00:00:00 2001 From: Adam Moussa <166072409+amoussa1229@users.noreply.github.com> Date: Wed, 13 May 2026 16:04:41 -0400 Subject: [PATCH] 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. --- .github/workflows/claude-code-review.yaml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/claude-code-review.yaml b/.github/workflows/claude-code-review.yaml index dd78d3f..c4e8da8 100644 --- a/.github/workflows/claude-code-review.yaml +++ b/.github/workflows/claude-code-review.yaml @@ -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