From 1517d73a89cd7c4a6a5786c77d349cd325cc00c6 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 27 Nov 2025 07:06:13 +0000 Subject: [PATCH] fix: change code review workflow to trigger on /review command Instead of triggering on every PR update (opened, synchronize), the workflow now only runs when someone comments /review on a PR. --- .github/workflows/claude-code-review.yml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 205b0fe..9689014 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -1,22 +1,15 @@ name: Claude Code Review on: - pull_request: - types: [opened, synchronize] - # Optional: Only run on specific file changes - # paths: - # - "src/**/*.ts" - # - "src/**/*.tsx" - # - "src/**/*.js" - # - "src/**/*.jsx" + issue_comment: + types: [created] jobs: claude-review: - # Optional: Filter by PR author - # if: | - # github.event.pull_request.user.login == 'external-contributor' || - # github.event.pull_request.user.login == 'new-developer' || - # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' + # Only run on PR comments containing /review command + if: | + github.event.issue.pull_request && + contains(github.event.comment.body, '/review') runs-on: ubuntu-latest permissions: @@ -38,7 +31,7 @@ jobs: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} prompt: | REPO: ${{ github.repository }} - PR NUMBER: ${{ github.event.pull_request.number }} + PR NUMBER: ${{ github.event.issue.number }} Please review this pull request and provide feedback on: - Code quality and best practices