AutoReviewer
Use LLMs to perform automatic code reviews.
Install / Use
/learn @gvasilei/AutoReviewerREADME
🤖 Automated Code Reviews powered by ChatGPT 🤖
A GitHub action uses OpenAI's GPT-4 to perform automated code reviews. When you create a PR, our action will automatically review the code and suggest changes, just like a human code reviewer would.
🚀 How to use it
- Get an API Key from OpenAI
- Add it as a GitHub secret
- Setup an action that runs on every PR
name: 'code-review'
on: # rebuild any PRs and main branch changes
pull_request:
jobs:
code-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: gvasilei/AutoReviewer@0.5.1
env:
NODE_OPTIONS: '--experimental-fetch'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
exclude_files: '*.json, *.md, *.yml' # optionally exclude files based on a wildcard expression.
- Or when a label is added
name: 'code-review'
on: # rebuild any PRs and main branch changes
pull_request:
types: [labeled]
jobs:
code-review:
if: ${{ contains( github.event.label.name, 'AutoReview') }}
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: gvasilei/AutoReviewer@0.5.1
env:
NODE_OPTIONS: '--experimental-fetch'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
exclude_files: '*.json, *.md, *.yml' # optionally exclude files based on a wildcard expression.
Input parameters
| Parameter | Required | Default | Description |
|-------------------|--------------|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| github_token | True | | Necessary for communicating with GitHub. Autogenerated by the GHA |
| openai_api_key | True | | OpenAI API key |
| model_name | False | gpt-3.5-turbo | OpenAI ChatModel. Currently supports gpt-4 and gpt-3.5-turbo |
| model_temperature | False | 0 | OpenAI model temperature |
| exclude_files | False | | Provide a wildcard expression to exclude files from code review. For example, *.md will exclude all Markdown files. Multiple expressions are supported via commas, eg *.js, *.cjs |
🎉 Benefits
Using our GitHub action has many benefits, such as:
- Faster code reviews
- More consistent feedback
- Increased productivity
- Improved code quality
🤞 Limitations
- This GitHub Action is still in early development.
- While the action supports both
gpt-4andgpt-3.5-turbo,gpt-4gives much better suggestions.
🙌 Contributing
If you have any ideas or improvements to our GitHub action, feel free to submit a PR. We welcome all contributions!
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
