Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Advanced AI-powered code reviews with multiple model support

License

NotificationsYou must be signed in to change notification settings

lfsevergnini/ai-codereviewer

 
 

Repository files navigation

AI Code Reviewer is a GitHub Action that leverages multiple AI providers (OpenAI, Anthropic, Google) to provide intelligent feedback and suggestions on your pull requests. This powerful tool helps improve code quality and saves developers time by automating the code review process.

Features

  • Supports multiple AI providers:
    • OpenAI (ChatGPT)
    • Anthropic (Claude)
    • Google (Gemini)
  • Provides intelligent comments and suggestions for improving your code
  • Reviews only new changes in PR updates
  • Filters out files that match specified exclude patterns
  • Easy to set up and integrate into your GitHub workflow

Setup

  1. Choose your preferred AI provider and get an API key:

  2. Add the API key as a GitHub Secret in your repository:

    • OPENAI_API_KEY for OpenAI
    • ANTHROPIC_API_KEY for Claude
    • GOOGLE_AI_KEY for Google Gemini
  3. Create.github/workflows/code-review.yml:

name:AI Code Reviewon:pull_request:types:[opened, synchronize]permissions:write-alljobs:review:runs-on:ubuntu-lateststeps:      -uses:actions/checkout@v4            -name:AI Code Reviewuses:your-username/ai-code-reviewer@mainwith:GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}# Choose your AI provider and keyAI_PROVIDER:"openai"# or "anthropic" or "google"AI_API_KEY:${{ secrets.OPENAI_API_KEY }}AI_MODEL:"gpt-4o-mini"AI_TEMPERATURE:0.3# 0 to 1 - higher values = more creativity and variance# Optional configurationsAPPROVE_REVIEWS:trueMAX_COMMENTS:10# 0 to disablePROJECT_CONTEXT:"This is a Node.js TypeScript project"CONTEXT_FILES:"package.json,README.md"EXCLUDE_PATTERNS:"**/*.lock,**/*.json,**/*.md"

Configuration

InputDescriptionDefault
AI_PROVIDERAI provider to use (openai,anthropic,google)openai
AI_API_KEYAPI key for chosen providerRequired
AI_MODELModel to use (see supported models below)Provider's default
AI_TEMPERATURETemperature for AI model0
APPROVE_REVIEWSWhether to approve PRs automaticallytrue
MAX_COMMENTSMaximum number of review comments0
PROJECT_CONTEXTProject context for better reviews""
CONTEXT_FILESFiles to include in review (comma-separated)"package.json,README.md"
EXCLUDE_PATTERNSFiles to exclude (glob patterns, comma-separated)"**/*.lock,**/*.json,**/*.md"

Supported Models

All models supported by the provider should be supported.

Development

# Install dependenciesyarn install# Build TypeScript filesyarn build# Run unit testsyarntest# Package for distributionyarn package# Generate test PR payload (for e2e testing)yarn generate-pr-payload<owner><repo><pr_number># Run end-to-end testsyarn test:e2e<owner><repo><pr_number>

Testing Locally

To test the action locally:

  1. Create a.env file with your credentials:
GITHUB_TOKEN=your_github_tokenAI_PROVIDER=openai# or anthropic, googleAI_API_KEY=your_api_keyAI_MODEL=your_preferred_model
  1. Generate a test PR payload:
yarn generate-pr-payload<owner><repo> 123
  1. Run the e2e test:
yarn test:e2e<owner><repo> 123

Note: Make sure you have write access to the repository you're testing with.

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

License

MIT License - seeLICENSE for details.

About

Advanced AI-powered code reviews with multiple model support

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript88.3%
  • JavaScript11.7%

[8]ページ先頭

©2009-2025 Movatter.jp