Skip to content

Commit b9e8d6e

Browse files
authored
Revert CI: Claude review, trigger on git push [skip ci] (cppcheck-opensource#8927)
This reverts commit bee8b7b.
1 parent bee8b7b commit b9e8d6e

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

‎.github/workflows/claude-review.yml‎

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
# Automated code review of pull requests using Claude
22
#
3-
# A member/owner/collaborator requests a review by writing a PR comment
4-
# containing "@claude review".
3+
# - PRs opened by members/owners/collaborators are reviewed automatically.
4+
# - For other PRs a member/owner/collaborator can request a review by writing
5+
# a PR comment containing "@claude review".
56
#
6-
# pull_request_target is not used because the Claude GitHub App token exchange
7-
# rejects OIDC tokens from that event (401 "Invalid OIDC token").
8-
#
9-
# issue_comment runs the workflow file from the default branch with access to
10-
# secrets. The PR code is never checked out or executed.
7+
# pull_request_target and issue_comment run the workflow file from the base
8+
# branch with access to secrets. The PR code is never checked out or executed.
119
name: claude-review
1210

1311
on:
12+
pull_request_target:
13+
types: [opened, synchronize, ready_for_review, reopened]
1414
issue_comment:
1515
types: [created]
1616

1717
jobs:
1818
review:
1919
if: |
20-
github.event.issue.pull_request &&
21-
contains(github.event.comment.body, '@claude review') &&
22-
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
20+
(github.event_name == 'pull_request_target' &&
21+
github.event.pull_request.draft == false &&
22+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.pull_request.author_association)) ||
23+
(github.event_name == 'issue_comment' &&
24+
github.event.issue.pull_request &&
25+
contains(github.event.comment.body, '@claude review') &&
26+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))
2327
2428
runs-on: ubuntu-24.04
2529

@@ -40,7 +44,7 @@ jobs:
4044
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
4145
prompt: |
4246
REPO: ${{ github.repository }}
43-
PR NUMBER: ${{ github.event.issue.number }}
47+
PR NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }}
4448
4549
Review this pull request. Focus on correctness bugs, potential
4650
false positives/false negatives in checkers, performance problems

0 commit comments

Comments
 (0)