gemini-ai-code-reviewer  by truongnh1992

AI-powered code review for pull requests

Created 1 year ago
251 stars

Top 99.8% on SourcePulse

GitHubView on GitHub
Project Summary

This GitHub Action automates pull request code reviews using Google's Gemini AI. It targets developers seeking to enhance code quality and consistency by providing AI-generated feedback directly within PRs, streamlining the review process.

How It Works

The action analyzes code modifications in a pull request, optionally filtering out specified file types. It then sends relevant code segments to a chosen Gemini AI model for analysis. The AI generates suggestions and comments, which the action posts back as review comments on the GitHub pull request.

Quick Start & Requirements

  1. Obtain a Gemini API key from Google AI Studio.
  2. Add the key as a GitHub Secret named GEMINI_API_KEY in your repository.
  3. Create a .github/workflows/code-review.yml file with the provided workflow configuration.
  4. Trigger reviews by commenting /gemini-review on a pull request.
    • Prerequisites: Gemini API Key, GitHub Secrets, actions/checkout@v3, gh api, jq.
    • Models: Defaults to gemini-2.5-flash; gemini-2.5-pro is available.
    • Documentation: Google AI Studio, GitHub Secrets.

Highlighted Details

  • Supports configurable exclusion patterns for files (e.g., *.md, *.txt, package-lock.json).
  • Allows selection between gemini-2.5-flash (default, fast) and gemini-2.5-pro models.
  • Integrates directly into the GitHub pull request workflow via comments.

Maintenance & Community

No specific details on contributors, sponsorships, or community channels were found in the provided README.

Licensing & Compatibility

Licensed under the MIT License. This license is permissive and generally compatible with commercial use and closed-source projects.

Limitations & Caveats

Requires an external Gemini API key, which may incur costs depending on usage. The effectiveness of reviews is dependent on the Gemini model's capabilities and the quality of the prompts implicitly used by the action. Code analysis is performed on chunks of code, which might miss broader architectural issues.

Health Check
Last Commit

7 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
2
Star History
7 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Chaoyu Yang Chaoyu Yang(Founder of Bento), and
6 more.

pr-agent by The-PR-Agent

0.1%
12k
AI tool for pull request automation, feedback, and suggestions
Created 3 years ago
Updated 1 day ago
Feedback? Help us improve.