AI-powered code review for Pull Requests using GPT-5.2, GPT-5.2-Pro, GPT-5.1, and GPT-4o
Translation Versions: ENGLISH | 简体中文 | 繁體中文 | 한국어 | 日本語
The easiest way to get started - install our GitHub App and it will automatically review PRs.
-
Install the App: GPT-5.2 PR Review
-
Select repositories to enable code review on
-
Configure your OpenAI API key:
- Go to your repository Settings → Secrets and variables → Actions
- Click the Variables tab
- Click New repository variable
- Name:
OPENAI_API_KEY - Value: Your OpenAI API key from platform.openai.com
-
Done! The bot will automatically review new Pull Requests
Reviews appear with the GPT-5.2 branding and avatar.
Option 2: GitHub Actions (Self-hosted)
Run as a GitHub Action in your own workflow with your own OpenAI API key.
-
Add
OPENAI_API_KEYto your repository secrets -
Create
.github/workflows/cr.yml:
name: Code Review
permissions:
contents: read
pull-requests: write
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: micahstubbs/gpt-code-review@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
MODEL: gpt-5.2-2025-12-11| Variable | Description | Default |
|---|---|---|
MODEL |
OpenAI model to use | gpt-5.2-2025-12-11 |
LANGUAGE |
Response language | English |
PROMPT |
Custom review prompt | (built-in) |
MAX_PATCH_LENGTH |
Skip files with larger diffs | unlimited |
IGNORE_PATTERNS |
Glob patterns to ignore | none |
INCLUDE_PATTERNS |
Glob patterns to include | all |
REASONING_EFFORT |
GPT-5.x reasoning level | medium |
VERBOSITY |
Response detail level | medium |
| Model | Description |
|---|---|
gpt-5.2-2025-12-11 |
Recommended - excellent balance of quality and cost |
gpt-5.2-pro-2025-12-11 |
Premium tier for complex/critical reviews |
gpt-5.1-codex |
Optimized for code review |
gpt-5.1-codex-mini |
Cost-effective option |
gpt-5.1 |
General purpose |
gpt-4o, gpt-4o-mini |
Previous generation |
Alternative Providers
GitHub Models:
env:
USE_GITHUB_MODELS: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MODEL: openai/gpt-4oAzure OpenAI:
env:
AZURE_API_VERSION: 2024-02-15-preview
AZURE_DEPLOYMENT: your-deployment-name
OPENAI_API_ENDPOINT: https://your-resource.openai.azure.com
OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_KEY }}Self-hosting
For webhook-based deployment (instead of GitHub Actions):
- Clone the repository
- Copy
.env.exampleto.envand configure - Install and run:
yarn install
yarn build
pm2 start pm2.config.cjsSee Probot documentation for details.
docker build -t gpt-code-review .
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> gpt-code-reviewDevelopment
# Install dependencies
yarn install
# Build
yarn build
# Run tests
yarn test
# Start locally
yarn startIf you have suggestions or want to report a bug, open an issue.
For more, check out the Contributing Guide.
This project is inspired by codereview.gpt
ISC © 2025 anc95, micahstubbs, and contributors