LLM-powered pull request code review as a GitHub Action. Posts inline review comments using conventional comments format and submits a verdict (approve, request changes, or comment).
- Reviews PR diffs with full file context
- Uses conventional comment labels:
nit:,suggestion:,issue:,question:,thought:,chore:,praise: - Replies to comment threads when developers respond
- Resolves threads automatically when concerns are addressed
- Remembers prior comments to avoid repeating itself
- Configurable LLM provider (Gemini supported, more planned)
Add a workflow file to your repository:
# .github/workflows/review.yml
name: Code Review
on:
pull_request:
types: [opened, synchronize]
pull_request_review_comment:
types: [created]
permissions:
pull-requests: write
contents: read
jobs:
review:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: LimpidTech/codereview@main
with:
gemini-api-key: ${{ secrets.GEMINI_API_KEY }}Get a Gemini API key from Google AI Studio and add it as a repository or organization secret named GEMINI_API_KEY.
| Input | Required | Default | Description |
|---|---|---|---|
github-token |
no | ${{ github.token }} |
GitHub token for API access |
provider |
no | gemini |
LLM provider to use |
gemini-api-key |
no | API key for Google Gemini | |
model |
no | gemini-2.5-flash |
Model name override |
instructions |
no | Additional review instructions | |
bot-login |
no | github-actions[bot] |
Bot username for loop prevention |
- uses: LimpidTech/codereview@main
with:
provider: gemini
gemini-api-key: ${{ secrets.GEMINI_API_KEY }}To use a specific model:
- uses: LimpidTech/codereview@main
with:
gemini-api-key: ${{ secrets.GEMINI_API_KEY }}
model: gemini-2.5-proThe codebase is designed for easy provider addition. Each provider implements a single function type:
type ReviewFunc func(ctx context.Context, req Request) (Response, error)See internal/provider/gemini/ for a reference implementation.
Use the instructions input to guide the reviewer toward your project's conventions:
- uses: LimpidTech/codereview@main
with:
gemini-api-key: ${{ secrets.GEMINI_API_KEY }}
instructions: |
This is a Go project using the standard library only.
We prefer table-driven tests.
Error messages should not be capitalized.
All exported functions must have doc comments.Instructions are prepended to the review prompt, so the LLM will consider them alongside the diff and file context.
- Fetches the PR diff and full contents of changed files
- Fetches any prior review comments it has already made
- Sends everything to the configured LLM with review instructions
- Posts inline review comments with conventional labels
- Submits a verdict:
APPROVE,REQUEST_CHANGES, orCOMMENT
- Fetches the full conversation thread
- Sends the thread context and relevant diff hunk to the LLM
- Posts a reply
- If the concern is resolved, automatically resolves the thread (only for threads it started)
The workflow needs these permissions:
permissions:
pull-requests: write # post reviews, reply to comments, resolve threads
contents: read # fetch file contents for contextIf you use a GitHub App token instead of the default GITHUB_TOKEN, set bot-login to the app's bot username so it doesn't reply to its own comments:
- uses: LimpidTech/codereview@main
with:
github-token: ${{ steps.app-token.outputs.token }}
gemini-api-key: ${{ secrets.GEMINI_API_KEY }}
bot-login: my-app[bot]BSD 2-Clause. See LICENSE for details.