An intelligent GitHub Action that provides automated, AI-powered code reviews on your pull requests. It features a resilient fallback system, visual summaries, and smart diff analysis to deliver professional-grade feedback.
- 📊 Visual PR Summary: Each review starts with a Mermaid sequence diagram summarizing the changes.
- 🧠 Intelligent Diff Analysis: Automatically prioritizes critical files in large pull requests to stay within token limits.
- 🔄 Resilient Fallback System: If the primary GitHub Models API fails, it seamlessly switches to a self-hosted Ollama model.
- 🤖 Multi-Provider Support: Natively supports GitHub Models and any model compatible with Ollama.
- ✅ Comprehensive Reviews: Analyzes code for security, performance, best practices, and style.
- 🚀 Zero-Setup Ready: Works out of the box with the standard
GITHUB_TOKEN
.
This action requires the following permissions in your workflow file to read code and post comments.
permissions:
contents: read
pull-requests: write
This configuration uses the default settings and is the quickest way to get started. Create a file like .github/workflows/code-review.yml
:
name: KeployAI Code Review
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
pull-requests: write
jobs:
ai-review:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to get the full git history for diffing
- name: Run Smart AI Code Review
uses: keploy/code-review-agent@v1
with:
github-token: ${{ secrets.GH_TOKEN }}
This configuration customizes the models, temperature, and file patterns.
name: Advanced KeployAI Code Review
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
pull-requests: write
jobs:
ai-review:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Smart AI Code Review
uses: keploy/code-review-agent@v1
with:
github-token: ${{ secrets.GH_TOKEN }}
model: 'gpt-4o'
ollama-model: 'gemma3n:e4b'
temperature: 0.1
ignore-patterns: '*.md,*.lock,dist/**'
See the action.yml
file for a full list of inputs and their descriptions.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.