Skip to content

Commit 7f6cde6

Browse files
authored
Change the trigger for claude (#1161)
1 parent afd3df6 commit 7f6cde6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/claude.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ name: Claude PR Comment Review
33
# https://skywork.ai/blog/how-to-use-claude-code-for-prs-code-reviews-guide/#step-3-add-a-comment-triggered-workflow-copy-pasteable
44

55
on:
6+
issue_comment:
7+
types: [created]
68
pull_request_review_comment:
79
types: [created]
810

911
jobs:
1012
review:
11-
if: ${{ contains(github.event.comment.body, '@claude') }}
13+
if: ${{ contains(github.event.comment.body, '@claude') && (github.event.issue.pull_request != null || github.event.pull_request != null) }}
1214
runs-on: ubuntu-latest
1315
permissions:
1416
contents: read
@@ -25,7 +27,7 @@ jobs:
2527
track_progress: true # ✨ Enables tracking comments
2628
prompt: |
2729
REPO: ${{ github.repository }}
28-
PR NUMBER: ${{ github.event.pull_request.number }}
30+
PR NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }}
2931
3032
Please review this pull request checked out in the current working directory with a focus on:
3133
- Code quality and best practices
@@ -41,6 +43,6 @@ jobs:
4143
- Check for duplication of code already in the repository; aim for re-use where sensible
4244
- Favour composition over inheritence
4345
- Respond in concise bullet point form; avoid restating code
44-
46+
4547
claude_args: |
4648
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)"

0 commit comments

Comments
 (0)