You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by de...@apache.org on 2026/10/14 17:59:23 UTC
(beam) branch 20261014_updateReviewBot created (now d779df57990)
This is an automated email from the ASF dual-hosted git repository.
derrickaw pushed a change to branch 20261014_updateReviewBot
in repository https://gitbox.apache.org/repos/asf/beam.git
at d779df57990 add a draft gemini review check
This branch includes the following new commits:
new d779df57990 add a draft gemini review check
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(beam) 01/01: add a draft gemini review check
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
derrickaw pushed a commit to branch 20261014_updateReviewBot
in repository https://gitbox.apache.org/repos/asf/beam.git
commit d779df57990ea9bde1b5a6c45483e354ff0d97dd
Author: Derrick Williams <de...@google.com>
AuthorDate: Wed Oct 14 17:58:43 2026 +0000
add a draft gemini review check
---
.github/workflows/gemini_code_review.yml | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/.github/workflows/gemini_code_review.yml b/.github/workflows/gemini_code_review.yml
index 397ebe01644..f039e011c0e 100644
--- a/.github/workflows/gemini_code_review.yml
+++ b/.github/workflows/gemini_code_review.yml
@@ -50,13 +50,42 @@ jobs:
pull-requests: write
steps:
+ - name: Check for existing Gemini review from draft
+ id: check_draft_review
+ if: github.event_name == 'pull_request_target' && github.event.action == 'ready_for_review'
+ uses: actions/github-script@v9
+ env:
+ PR_NUMBER: ${{ github.event.pull_request.number }}
+ with:
+ script: |
+ const prNumber = Number(process.env.PR_NUMBER);
+ const reviews = await github.paginate(github.rest.pulls.listReviews, {
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ pull_number: prNumber,
+ per_page: 100,
+ });
+ const reviewedInDraft = reviews.some(
+ r =>
+ r.user &&
+ r.user.login === 'github-actions[bot]' &&
+ typeof r.body === 'string' &&
+ r.body.includes('/gemini review')
+ );
+ if (reviewedInDraft) {
+ core.info(`PR #${prNumber} was already reviewed by Gemini while in draft; skipping automatic review on ready_for_review.`);
+ }
+ core.setOutput('reviewed_in_draft', reviewedInDraft ? 'true' : 'false');
+
- name: Setup Node.js
+ if: steps.check_draft_review.outputs.reviewed_in_draft != 'true'
uses: actions/setup-node@v7
with:
node-version: '20'
- name: Run Gemini Enterprise Code Review Agent
id: gemini_review
+ if: steps.check_draft_review.outputs.reviewed_in_draft != 'true'
shell: bash
env:
GEMINI_CLI_TRUST_WORKSPACE: 'true'
@@ -125,6 +154,7 @@ jobs:
fi
- name: Post PR Review to GitHub
+ if: steps.check_draft_review.outputs.reviewed_in_draft != 'true'
uses: actions/github-script@v9
env:
PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number || inputs.pr_number }}