Run AI Code Review on pushes to main branch and Pull Requests using Gemini Flash 2.5 model with previous feedback reevaluation ✨
- Automatically runs
on pushes to main branch and Pull Requests (creation, update , reopen) - Talks to you as your custom [bot]
or as github-actions[bot] if you didn't set it up - Auto-commits AI-actionable JSON report as your custom [bot]
to your repo/reviews/
folder for futher agentic processing
or as zen-ai-qa[bot] if you didn't update the hardcoded git settings in.yml
files - Uses JSON file in question during next run
for better context and logical consistency - Batches hunks related to same files
to optimize rate limiting - Makes use of Gemini 1 million tokens context window
by attaching whole file together with changes for better context - Optimized diff parsing algoritm
that works better with GitHub (maybe?) - Uses Structured Output mode of Gemini API
for better parsing of AI output - Compares actual changes to commit titles
on pushes to main branch only
- Put
.py
and.yml
files in.github/workflows/
folder of your repo - Go to AI Studio and obtain Gemini API key there
- On the repo page where you want to run this bot
Go toSettings
->Secrets and variables
->Actions
- Click
New repository secret
- Name:
GEMINI_API_KEY
- Secret: the API key you just got from AI Studio in JSON format: [ key ]
- Name:
- Click
- It will automatically run on pushes to main branch and pull request creation , update and reopen
- For pushes to main branch, detailed review feedback since last push will be auto-commited to your repo
/reviews/
folder (separate from PR feedback) - For Pull Requests, detailed review feedback will be commented by your custom [bot] on completion
and auto-commited to same folder (separate from main branch commits feedback)
- Make your own app in Developer settings and use its installation ID and key! 🗝️
- From repo page on Github go to
Settings
->Secrets and variables
->Actions
- Click
New repository secret
- Set
ZEN_APP_INSTALLATION_ID
with the installation ID
you can find installation ID in url of app settings page (the one that displays after you install app on your account or org, not the one where you generate private key) - Set
ZEN_APP_PRIVATE_KEY
with your app private key generated in app settings - Replace hardcoded App ID in
.py
file with your own app ID
Inspired by truongnh1992/gemini-ai-code-reviewer
- Set
- Click