Skip to content

Add GitHub Actions workflow for Antigravity AI code review - #9284

Open
dschuff wants to merge 2 commits into
mainfrom
agy-review
Open

dschuff wants to merge 2 commits into
mainfrom
agy-review

Conversation

@dschuff

@dschuff dschuff commented Oct 20, 2026

Copy link
Copy Markdown
Member

No description provided.

@dschuff
dschuff requested a review from a team as a code owner October 20, 2026 05:36
@dschuff
dschuff requested review from tlively and removed request for a team October 20, 2026 05:36
@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Google Antigravity Code Review

I have reviewed the changes in this Pull Request and left inline feedback.

Comment thread .github/workflows/ai-review.yml
Comment thread .github/workflows/ai-review.yml
Comment thread .github/workflows/ai-review.yml
@dschuff

dschuff commented Oct 20, 2026 •

Copy link
Copy Markdown
Member Author

This is another option for automated review. It looks like it works purely from actions. I tried it in my fork and it seems to work. Reviews look like this.

@tlively

tlively commented Oct 20, 2026

Copy link
Copy Markdown
Member

Cool, should we just enable this in addition to Gemini Code Assist and see which one is better? @kripken

@kripken

kripken commented Oct 20, 2026

Copy link
Copy Markdown
Member

Definitely worth experimenting with, but according to the bot's own feedback, (1) this risks exposing the secret key, and (2) does not expose the secret key so external PRs will not get reviewed. Do these not contradict each other..? 😆 Also, each sounds rather serious...

@dschuff

dschuff commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

The first comment is not about exposing the key per se, but allowing anyone to post a comment and trigger review on a PR that they don't own. As the comment notes, this allows redundant overuse of the API but not key leaks. Because the 3rd comment is also correct; secrets are not passed to forked pull requests. This seems more problematic actually, and maybe it's the real reason why a Github App like Gemini Code Assist could be better for external reviews. Let me see if there's a solution here.

@dschuff

dschuff commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

OK actually there's one additional subtlety here:

  1. workflows run on: pull_request run in the untrusted context of the external fork, so no secrets get passed and review won't work directly.
  2. on: issue_comment runs on main in the base repository, so it does have access to repository secrets. So as mentioned above the risk isn't secret leakage but quota abuse. But it does mean that we can still cause reviews to happen on forked PRs by adding the /review comment. I just uploaded a commit that adds extra checks to limit who can trigger the reviews. It also fixes the checkout so we get the PR commit even when triggered by the comment (that's comment 2).

@dschuff

dschuff commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Google Antigravity Code Review

I have reviewed the changes in this Pull Request and left inline feedback.

ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/merge', github.event.issue.number) || github.ref }}

- name: Run Antigravity Review Agent
uses: anguillanneuf/run-antigravity-cli@master

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH | Confidence: 5/5 | SECURITY]

The workflow references a third-party action using a mutable branch reference (uses: anguillanneuf/run-antigravity-cli@master). Referencing a mutable branch from an external repository is a supply chain security risk: if the branch is compromised or updated unexpectedly, arbitrary code could execute in an environment with elevated permissions (pull-requests: write, issues: write) and access to repository secrets (GEMINI_API_KEY, GITHUB_TOKEN).

Pin the action to an immutable full-length commit SHA rather than @master:

Suggested change
uses: anguillanneuf/run-antigravity-cli@master
uses: anguillanneuf/run-antigravity-cli@<commit-sha> # e.g. v1.x

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dschuff any idea why this reads a personal repo and not something more official looking?

- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/merge', github.event.issue.number) || github.ref }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH | Confidence: 5/5 | BUG]

Using format('refs/pull/{0}/merge', github.event.issue.number) will cause the checkout step to fail on PRs that have merge conflicts. GitHub only creates and maintains the refs/pull/<pr_number>/merge ref when a pull request can be cleanly merged into the base branch. If merge conflicts exist, actions/checkout fails with fatal: couldn't find remote ref refs/pull/.../merge.

Use refs/pull/{0}/head instead, which is guaranteed to exist for all pull requests regardless of conflict status:

Suggested change
ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/merge', github.event.issue.number) || github.ref }}
ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/head', github.event.issue.number) || github.event.pull_request.head.sha }}

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants