A GitHub Action that uses Google's Gemini AI to analyze pull requests and identify potential bugs, performance improvements, and suggest code enhancements.
- 🔍 Automatically analyzes pull requests when they are opened or reopened
- 🐛 Identifies potential bugs in code changes
- ⚡ Suggests performance optimizations
- 💡 Provides intelligent code improvement suggestions
- 🤖 Powered by Google's Gemini AI model
- Add this action to your repository's workflow:
on:
pull_request:
types: [opened, reopened]
jobs:
pr_review:
runs-on: ubuntu-latest
name: A job to review a PR with an LLM
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout action
uses: actions/checkout@v4
- name: Install action packages
shell: 'bash'
run: npm install
- name: PullRequestReviewAction
uses: .github/actions
id: pr_review
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
geminiApiKey: ${{ secrets.GEMINI_API_KEY }}
- name: Get the output time
run: echo "The time was ${{ steps.review_pr.outputs.time }}"
- Set up the required secrets in your repository:
GITHUB_TOKEN
: Automatically provided by GitHubGEMINI_API_KEY
: Your Google Gemini API key
When a pull request is opened or reopened, the action:
- Retrieves the changes made in the pull request
- Analyzes the code changes using Gemini AI
- Generates a detailed review that includes:
- Initial analysis of changes
- Potential bugs and issues
- Performance optimization suggestions
- Code improvement recommendations
- Confidence score for the suggestions
@actions/core
: ^1.10.1@actions/github
: ^6.0.0@google/generative-ai
: ^0.11.5mustache
: ^4.2.0
# Install dependencies
bun install
# Build the action
bun run build
# Compile the action
bun run compile
This project is licensed under the terms specified in the repository's license file.