1- name : Antigravity Code Review
1+ name : automated code review
22
3+ # TODO: Eventually, use pull_request_target instead of pull_request.
4+ # pull_request_target runs in the base branch context and has access
5+ # to secrets (like GEMINI_API_KEY) even for fork PRs.
6+ # Using pull_request for now during setup/testing.
37on :
4- pull_request_target :
8+ pull_request :
59 types : [opened]
610 pull_request_review_comment :
711 types : [created]
@@ -14,21 +18,21 @@ jobs:
1418 review :
1519 runs-on : ubuntu-latest
1620 # Trigger only if:
17- # 1. It is a pull_request_target event, it is NOT a draft, and the author is a maintainer
21+ # 1. It is a pull_request event, it is NOT a draft, and the author is a maintainer
1822 # (OWNER, MEMBER, or COLLABORATOR).
19- # 2. OR it is an pull_request_review_comment event, the comment body has a line starting with "/review",
23+ # 2. OR it is a pull_request_review_comment event, the comment body has a line starting with "/review",
2024 # and the commenter is a maintainer.
2125 if : >
22- (github.event_name == 'pull_request_target ' && !github.event.pull_request.draft &&
23- (github.event.pull_request.author_association == ' OWNER' || github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'COLLABORATOR' )) ||
26+ (github.event_name == 'pull_request ' && !github.event.pull_request.draft &&
27+ contains(fromJson('[" OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association)) ||
2428 (github.event_name == 'pull_request_review_comment' &&
2529 (startsWith(github.event.comment.body, '/review') || contains(github.event.comment.body, '\n/review')) &&
26- (github.event.comment.author_association == ' OWNER' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR' ))
30+ contains(fromJson('[" OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association))
2731 steps :
28- - name : Checkout PR Branch (Untrusted)
32+ - name : Checkout PR Branch
2933 uses : actions/checkout@v7
3034 with :
31- ref : refs/pull/ ${{ github.event.pull_request.number }}/merge
35+ ref : ${{ github.event.pull_request.head.sha }}
3236 persist-credentials : false
3337
3438 - name : Checkout Reviewbot (Base Branch)
0 commit comments