From de05ee85733d543380624558ea373aab384814d2 Mon Sep 17 00:00:00 2001 From: Slyghtning Date: Thu, 12 Mar 2026 10:00:05 +0100 Subject: [PATCH] .github: add @claude mention trigger to review workflow (#1093) --- .github/workflows/claude-code-review.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 049a6b4f..cc34fa40 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -1,12 +1,19 @@ name: Claude Code Review on: + issue_comment: + types: [created] pull_request: types: [labeled, synchronize] jobs: claude-review: - if: contains(github.event.pull_request.labels.*.name, 'claude-review') + if: | + (github.event_name == 'issue_comment' && + contains(github.event.comment.body, '@claude') && + github.event.issue.pull_request) || + (github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'claude-review')) runs-on: ubuntu-latest permissions: contents: read @@ -27,7 +34,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.pull_request.number || github.event.issue.number }} Please review this pull request and provide feedback on: - Code quality and best practices @@ -42,4 +49,4 @@ jobs: # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://docs.claude.com/en/docs/claude-code/cli-reference for available options - claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"' + claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"' \ No newline at end of file