Skip to content

Commit fa814da

Browse files
feat(/review): support pull_request_review & pull_request_review_comment events (#161)
### Overview This adds support for invoking `@gemini-cli /review` in `pull_request_review` & `pull_request_review_comment` events. ### Testing 1. Test the `pull_request_review_comment` trigger: * Went to the "Files changed" tab of a pull request. * Added a comment on a line of code. * Use the phrase `@gemini-cli /review (single comment)` * Submitted the comment. 2. Test the `pull_request_review` trigger: * Went to the "Files changed" tab of a pull request. * Clicked the "Review changes" button in the top right. * Used the phrase `@gemini-cli /review (review changes comment)` * Selected "Comment" and submitted the review. Fixes #150
1 parent 99181d3 commit fa814da

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

.github/workflows/gemini-pr-review.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ jobs:
109109
} >> "${GITHUB_OUTPUT}"
110110
111111
112-
- name: 'Get PR details (issue_comment)'
112+
- name: 'Get PR details (issue_comment & reviews)'
113113
id: 'get_pr_comment'
114114
if: |-
115-
${{ github.event_name == 'issue_comment' }}
115+
${{ github.event_name == 'issue_comment' || github.event_name == 'pull_request_review' || github.event_name == 'pull_request_review_comment' }}
116116
env:
117117
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
118-
COMMENT_BODY: '${{ github.event.comment.body }}'
119-
PR_NUMBER: '${{ github.event.issue.number }}'
118+
COMMENT_BODY: '${{ github.event.comment.body || github.event.review.body }}'
119+
PR_NUMBER: '${{ github.event.issue.number || github.event.pull_request.number }}'
120120
run: |-
121121
set -euo pipefail
122122

examples/workflows/pr-review/gemini-pr-review.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ jobs:
109109
} >> "${GITHUB_OUTPUT}"
110110
111111
112-
- name: 'Get PR details (issue_comment)'
112+
- name: 'Get PR details (issue_comment & reviews)'
113113
id: 'get_pr_comment'
114114
if: |-
115-
${{ github.event_name == 'issue_comment' }}
115+
${{ github.event_name == 'issue_comment' || github.event_name == 'pull_request_review' || github.event_name == 'pull_request_review_comment' }}
116116
env:
117117
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
118-
COMMENT_BODY: '${{ github.event.comment.body }}'
119-
PR_NUMBER: '${{ github.event.issue.number }}'
118+
COMMENT_BODY: '${{ github.event.comment.body || github.event.review.body }}'
119+
PR_NUMBER: '${{ github.event.issue.number || github.event.pull_request.number }}'
120120
run: |-
121121
set -euo pipefail
122122

0 commit comments

Comments
 (0)