Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions .github/workflows/gemini-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: '🔎 Gemini Review'

on:
pull_request:
types:
- 'opened'
- 'reopened'
- 'synchronize'

concurrency:
group: '${{ github.workflow }}-review-${{ github.event.pull_request.number }}'
cancel-in-progress: true

defaults:
run:
shell: 'bash'

jobs:
review:
if: |-
github.event.pull_request.head.repo.fork == false
runs-on: 'ubuntu-latest'
timeout-minutes: 7
permissions:
contents: 'read'
id-token: 'write'
issues: 'write'
pull-requests: 'write'
steps:
- name: 'Checkout repository'
uses: 'actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8' # ratchet:actions/checkout@v6
with:
persist-credentials: 'false'

- name: 'Prepare prompt context'
shell: 'bash'
run: |-
mkdir -p .gemini
jq -n \
--arg repo "${REPOSITORY}" \
--arg pr "${PULL_REQUEST_NUMBER}" \
'{repository: $repo, pull_request_number: $pr}' > .gemini/context.json
env:
REPOSITORY: '${{ github.repository }}'
PULL_REQUEST_NUMBER: '${{ github.event.pull_request.number }}'

- name: 'Run Gemini pull request review'
uses: 'google-github-actions/run-gemini-cli@v0' # ratchet:exclude
id: 'gemini_pr_review'
env:
GEMINI_CLI_TRUST_WORKSPACE: 'true'
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
GEMINI_API_KEY: '${{ secrets.GEMINI_PR_REVIEWER }}'
with:
gemini_api_key: '${{ secrets.GEMINI_PR_REVIEWER }}'
workflow_name: 'gemini-review'
github_pr_number: '${{ github.event.pull_request.number }}'
settings: |-
{
"model": {
"maxSessionTurns": 25
},
"telemetry": {
"enabled": true,
"target": "local",
"outfile": ".gemini/telemetry.log"
},
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server:v0.27.0"
],
"includeTools": [
"add_comment_to_pending_review",
"pull_request_read",
"pull_request_review_write"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
}
}
},
"tools": {
"core": []
}
}
extensions: |
[
"https://github.com/gemini-cli-extensions/code-review"
]
prompt: '/pr-code-review'
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ src/main/resources/META-INF/additional-spring-configuration-metadata.json

# Antigravity & Agent Customizations
.agents/

# Gemini CLI (gemini-review workflow)
.gemini/
gha-creds-*.json
Loading