π New Feature: You can now CHAT with Review Buddy! Just reply to any comment with
/buddyto ask questions or debate the review. π¬
Review Buddy is an intelligent, AI-powered GitHub Action that acts as your personal pair programmer. It doesn't just review your codeβit understands it.
Review Buddy automates the boring parts of Code Review:
- Code Quality & Comments: It reviews your code line-by-line using AI to find bugs, security risks, and bad practices. (Note: It performs static AI analysis, it does NOT run your unit tests).
- Smart Metadata Updates:
- PR Title: Renames your PR to follow Conventional Commits (e.g.,
fix: login buginstead ofupdate). - Description: Writes a full, formatted description (Summary, Changes, Testing Guide) if you didn't provides one.
- Labels: Automatically adds relevant labels based on change type, quality score, and detected issues.
- PR Title: Renames your PR to follow Conventional Commits (e.g.,
- Best Practices Suggestions: Identifies code patterns that can be improved with modern best practices (e.g.,
if (a == undefined)βif (!a), usingconst/letinstead ofvar, arrow functions, template literals, etc.) with before/after examples. - Engaging Feedback: comments on your PR in your chosen tone (Professional or Roast).
- Final Recommendation: Provides a clear recommendation (Approve/Request Changes/Reject) with actionable next steps for reviewers.
- Interactive Chat: Reply to any comment with
/Buddy(e.g., "Why is this wrong? /Buddy") and Review Buddy will explain!
Copy this into .github/workflows/review_buddy.yml:
name: Review Buddy
on:
pull_request:
types: [opened, synchronize]
issue_comment:
types: [created]
permissions:
pull-requests: write
contents: read
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nexoral/ReviewBuddy@main
with:
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}π° Cost-Efficient: Review Buddy makes only ONE AI API call per PR to generate the complete review report (code analysis, suggestions, description, labels, and recommendation). No expensive multi-call workflowsβjust fast, affordable AI reviews!
π Multi-Provider: Supports Gemini (default) and OpenRouter (access 100+ models). Bring your own API key and model!
π Simple & Smart: Just add one API key with a small config file, and your Repo PR becomes smarter!
Let's be honestβwriting PR descriptions is boring. We often push code with titles like "update" and leave the description empty, forcing reviewers to dig through files to guess what's happening.
I built Review Buddy to solve this:
- Context is King: It forces every PR to have a clear, descriptive summary so reviewers know exactly what they are looking at immediately.
- Standardization: It enforces clean titles and robust descriptions without any manual user effort.
- Decision Support: Reviewers no longer have to wonder "should I approve this?" - Review Buddy provides clear, data-driven recommendations.
- Fun Factor: Code reviews can be dry. Adding a "Hinglish Roast" mode makes the process engaging and bringing the team closer together through humor.
- π Auto-Documentation: Automatically writes a detailed PR description (Summary + Changes + Testing) if the original is lacking.
- π·οΈ Smart Retitling: Detects the nature of changes and renames the PR to be semantic (e.g.,
fix:,feat:,chore:). - π·οΈ Intelligent Label Management: Automatically adds relevant labels based on:
- Change Type:
enhancement(feat),bug(fix),documentation(docs),testing(test),maintenance(chore/ci/build) - Quality Score:
good first review(90+),needs work(<50) - Security Concerns:
security(if Critical/High issues detected) - Performance Issues:
performance(if optimization opportunities found)
- Change Type:
- π‘ Best Practices Suggestions: Identifies code patterns that can be improved:
- Loose equality checks (
==) β Strict equality (===) if (a == undefined)βif (!a)orif (a === undefined)vardeclarations βconstorlet- Traditional functions β Arrow functions (where appropriate)
- Manual string concatenation β Template literals
- Callback hell β
async/awaitor Promises - For loops β Modern array methods (
map,filter,reduce) - Each suggestion includes before/after code examples with explanations
- Loose equality checks (
- π― Smart PR Recommendations: Posts a final recommendation comment with:
- β APPROVE: High quality code (80+), no critical issues - ready to merge
β οΈ REQUEST CHANGES: Medium quality (40-79) or some concerns - needs improvements- π« REJECT: Critical security issues or very low quality (<40) - major fixes required
- Includes reasoning, review checklist, and clear next steps for reviewers
- π¬ Adaptive Persona:
roast(Default): A fun, "senior dev" persona that playfully roasts bad code.professional: Helpful, clean, and mentorship-focused.funny: Adds humor using emojis and light jokes.friendly: Encouraging and kind.
- π Multi-Language Support:
hinglish(Default): A mix of Hindi and English (Perfect for Indian dev teams!).english: Standard Professional English.- Any other language supported by the AI model.
- π Multi-Provider Support:
gemini(Default): Google Gemini API (gemini-3-flash-previewby default).openrouter: Access 100+ models via OpenRouter (Claude, GPT, Llama, Mistral, etc.).github-models: Use GitHub Models API with access to OpenAI, Meta, Mistral models and more.
| Input | Description | Required | Default |
|---|---|---|---|
github_token |
GitHub Token (use secrets.GITHUB_TOKEN) |
No | ${{ github.token }} |
gemini_api_key |
Google Gemini API Key (required for gemini adapter) |
Conditional | N/A |
adaptive_api_token |
Generic API Token for OpenRouter or GitHub Models | Conditional | N/A |
adapter |
AI provider (gemini, openrouter, or github-models) |
No | gemini |
model |
Model name (optional - smart defaults for each adapter) | No | See below |
tone |
The personality (professional, funny, roast, friendly) |
No | roast |
language |
Language of the review (e.g., english, hinglish) |
No | hinglish |
pr_number |
The PR number to process | No | Auto-detected |
Default Models:
gemini:gemini-3-flash-previewopenrouter:openrouter/auto(auto-selects best free/cheap model)github-models:openai/gpt-4o
Required Permissions
To function correctly, the github_token needs specific permissions. If using the default GITHUB_TOKEN, ensure your workflow YAML includes:
permissions:
pull-requests: write # Allowed to comment and update PR body/title
contents: read # Allowed to read the code diffOption 1: Using the Default GITHUB_TOKEN (Recommended)
Simply add this permissions block to your workflow file:
permissions:
pull-requests: write # Allows commenting & editing PR details
contents: read # Allows reading the code diffOption 2: Creating a Personal Access Token (PAT) If you choose to use a PAT instead, follow these settings when creating it:
- Classic Token:
- Check [x]
repo(Full control of private repositories) or [x]public_repo.
- Check [x]
- Fine-grained Token (More Secure):
- Repository Access: Select target repositories.
- Permissions:
- Pull Requests:
Read and Write - Contents:
Read-only
- Pull Requests:
Create a workflow file in your repository at .github/workflows/review-buddy.yml.
Best for internal teams who want a mix of utility and fun.
name: Review Buddy CI
on:
pull_request:
types: [opened, synchronize]
issue_comment:
types: [created]
permissions:
pull-requests: write
contents: read
jobs:
review:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Run Review Buddy
uses: nexoral/ReviewBuddy@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
# Defaults: tone='roast', language='hinglish'Best for open-source or strict business environments.
- name: Run Review Buddy
uses: nexoral/ReviewBuddy@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
tone: 'professional'
language: 'english'Use a specific Gemini model.
- name: Run Review Buddy
uses: nexoral/ReviewBuddy@main
with:
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
model: 'gemini-2.5-pro'Use any model via OpenRouter (Claude, GPT, Llama, Mistral, etc.).
π― Smart Default: If you don't specify a model, Review Buddy uses
openrouter/autowhich automatically selects the best free or cheap model for your request!
β οΈ Important - Model Selection:
- Recommended models:
anthropic/claude-3.5-sonnet,google/gemini-2.0-flash-exp:free,openai/gpt-4o-mini,meta-llama/llama-3.3-70b-instruct- Avoid very small models (< 7B parameters) - they cannot follow complex JSON structures
- Small models may return errors, shallow reviews, and fail to update PR titles/descriptions
With automatic model selection:
- name: Run Review Buddy
uses: nexoral/ReviewBuddy@main
with:
adapter: 'openrouter'
adaptive_api_token: ${{ secrets.OPENROUTER_API_KEY }}
tone: 'roast'
language: 'hinglish'
# model is optional - will use openrouter/autoWith specific model:
- name: Run Review Buddy
uses: nexoral/ReviewBuddy@main
with:
adapter: 'openrouter'
adaptive_api_token: ${{ secrets.OPENROUTER_API_KEY }}
model: 'anthropic/claude-3.5-sonnet'
tone: 'professional'
language: 'english'Use GitHub Models API with your GitHub token. Access OpenAI GPT, Meta Llama, and more!
π New Feature: GitHub Models provides access to cutting-edge AI models directly through your GitHub token. No separate API key needed!
π― Smart Default: Uses
openai/gpt-4oby default - the best balance of quality and speed!
With default model (gpt-4o):
- name: Run Review Buddy
uses: nexoral/ReviewBuddy@main
with:
adapter: 'github-models'
adaptive_api_token: ${{ secrets.GITHUB_TOKEN }}
tone: 'roast'
language: 'hinglish'
# model is optional - will use openai/gpt-4oWith specific model:
- name: Run Review Buddy
uses: nexoral/ReviewBuddy@main
with:
adapter: 'github-models'
adaptive_api_token: ${{ secrets.GITHUB_TOKEN }}
model: 'openai/gpt-5'
tone: 'roast'
language: 'hinglish'Available Models:
openai/gpt-5- Latest OpenAI (Recommended for best quality)openai/gpt-4o- Default, excellent balance (β Default)openai/gpt-4o-mini- Fast and efficientmeta-llama/llama-3.3-70b-instruct- Open source, powerfulmistralai/mistral-large- Great for code
π‘ Tip: You can use the default
GITHUB_TOKENor create a personal access token from your GitHub Settings > Developer settings > Tokens.
Important: PRs from forks have read-only permissions by default. To allow Review Buddy to comment and update descriptions on forked PRs, use pull_request_target.
name: Review Buddy CI
on:
pull_request_target: # Required for Fork support
types: [opened, synchronize]
permissions:
pull-requests: write
contents: read
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Review Buddy
uses: nexoral/ReviewBuddy@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}Q: Why did it change my PR Title? A: Review Buddy detected that your title didn't match the content of your code (or was too generic). It uses AI to generate a Conventional Commit title so your git history remains clean.
Q: What labels does Review Buddy add automatically? A: Review Buddy intelligently adds labels based on the PR analysis:
- Change Type:
enhancement,bug,documentation,testing,maintenance - Quality:
good first review(high quality),needs work(low quality) - Concerns:
security,performance
Note: Labels must already exist in your repository. Review Buddy will skip labels that don't exist.
Q: What if the labels don't exist in my repository? A: Review Buddy will gracefully skip labels that don't exist. To use this feature fully, create the following labels in your repository:
enhancement,bug,documentation,testing,maintenancegood first review,needs worksecurity,performance
Q: How does Review Buddy decide whether to recommend Approve, Request Changes, or Reject? A: Review Buddy uses AI-driven verdict determination. Gemini analyzes the code and returns a structured verdict that considers:
- The perspective and purpose of the changes (e.g., config/docs changes are judged leniently, auth/security PRs are judged strictly)
- Whether security issues are real and exploitable, not just theoretical
- The overall code quality, maintainability, and risk
The recommendation is posted as a final comment with detailed reasoning and next steps.
Q: Can I dispute Review Buddy's verdict?
A: Yes! Reply with /buddy and explain your reasoning (e.g., "/buddy this is a config-only change, the security concerns don't apply here"). Review Buddy will re-evaluate the verdict based on your explanation and the full conversation context, and update the original recommendation comment if warranted.
Q: What does @main mean in uses: ...@main?
A: It tells GitHub Actions to use the latest version of the code from the main branch. For production stability, you may want to use a specific tag (e.g., @v1.0.0) once released.
For Gemini (Default):
- Get a Gemini API Key: Visit Google AI Studio to create a free API key.
- Add Secrets: Go to your repository Settings > Secrets and variables > Actions and add
GEMINI_API_KEY. - Add Workflow: Copy one of the usage examples above into a new yaml file in
.github/workflows/.
For OpenRouter:
- Get an OpenRouter API Key: Visit OpenRouter and create an API key.
- Add Secrets: Add
OPENROUTER_API_KEYto your repository secrets (or useADAPTIVE_API_TOKENfor a generic approach). - Add Workflow: Use the OpenRouter configuration example above, setting
adapter: 'openrouter'and your preferredmodel.
For GitHub Models:
- Get GitHub Token: Your repository already has
GITHUB_TOKENavailable, or create a Personal Access Token from GitHub Settings. - Add Secrets (optional): If using a custom token, add it as
GITHUB_TOKENorADAPTIVE_API_TOKENto your repository secrets. - Add Workflow: Use the GitHub Models configuration example above, setting
adapter: 'github-models'and your preferredmodel.
Verified Source Code structure for contributors:
ReviewBuddy/
βββ action.yml # GitHub Action definition & metadata
βββ VERSION # Current version tracker
βββ LICENSE # MIT License
βββ README.md # Documentation
βββ CODE_OF_CONDUCT.md # Community guidelines
βββ CONTRIBUTING.md # Contribution guidelines
βββ SECURITY.md # Security policy
βββ SUPPORT.md # Support documentation
βββ src/
β βββ index.js # Entry point & orchestration logic
β βββ github/
β β βββ index.js # GitHub API interactions (PR, comments, labels)
β βββ utils/
β β βββ index.js # Utilities (logging, scoring, recommendations)
β βββ prompts/
β β βββ reviewPrompt.js # PR review prompt text (provider-agnostic)
β β βββ chatPrompt.js # Chat reply prompt text (provider-agnostic)
β βββ adapters/
β βββ index.js # Adapter registry & factory
β βββ geminiAdapter.js # Google Gemini API adapter
β βββ openrouterAdapter.js # OpenRouter API adapter
β βββ githubModelsAdapter.js # GitHub Models API adapter
βββ .github/
βββ FUNDING.yml # GitHub Sponsors configuration
βββ pull_request_template.md # PR template
βββ ISSUE_TEMPLATE/
β βββ bug_report.md # Bug report template
β βββ feature_request.md # Feature request template
βββ workflows/
βββ review_buddy.yml # ReviewBuddy CI workflow
βββ auto-release.yml # Automated release on version bump
Contributions are welcome! Please ensure you:
- Fork the repo.
- Modify the scripts in
src/. - Test locally if possible.
- Submit a PR (Review Buddy will likely roast it!).
MIT