Repository navigation
Conversation
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
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. |
|
Cool, should we just enable this in addition to Gemini Code Assist and see which one is better? @kripken |
|
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... |
|
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. |
…t ref, and gate fork secrets
|
OK actually there's one additional subtlety here:
|
|
/review |
| 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 |
There was a problem hiding this comment.
[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:
| uses: anguillanneuf/run-antigravity-cli@master | |
| uses: anguillanneuf/run-antigravity-cli@<commit-sha> # e.g. v1.x |
There was a problem hiding this comment.
@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 }} |
There was a problem hiding this comment.
[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:
| 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 }} |
No description provided.