- Automatically generate an AI code review on every PR.
- Easily customize the AI prompt as needed.
- Works with both Azure OpenAI or OpenAI APIs.
- Add to any GitHub repo with only 3 files.
- View Sample AI Code Review
-
ai_code_review.yml
GitHub Actions file triggered upon pull request. -
ai_code_review.py
Python script to generate AI code review. -
requirements.txt
Python package dependencies (onlyopenaiandrequests).
- Open or create a GitHub repo.
- Confirm or create the .github/workflows/ directory.
- Add 3 files from this repo to your project.
- Choose your AI provider:
- Azure OpenAI is highly recommended for private and enterprise use.
- OpenAI is for public repos or when you give training consent.
- Update your GitHub repo settings:
- Browse to Repo > Settings > Security and variables > Actions
- Add action secrets:
OPENAI_API_KEYAZURE_OPENAI_ENDPOINTAZURE_OPENAI_API_KEYAZURE_OPENAI_API_VERSION(optional, default2024-02-15-preview)OPENAI_MODEL_NAME(optional, defaultgpt-4, or Azure deployment name)- Learn more about encrypted secrets
- Create new branch, push changes, and create new PR.
- Improve your code based on the automated AI feedback.
- Comment with AI code review posted on PR.
workflow.logcreated within each action run.