GitHub Action
Codellama Review
Important: This project is heavily inspired by ai-codereviewer
ai_code_review
is a GitHub Action that leverages self-deployed Ollama's REST API 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.
- Reviews pull requests using self-deployed Ollama's REST API.
- Provides intelligent comments and suggestions for improving your code.
- Filters out files that match specified exclude patterns.
- Easy to set up and integrate into your GitHub workflow.
-
To use this GitHub Action, you need a self-deployed Ollama service. If you don't have one, deploy your own according to ollama#Linux
-
Add the Ollama service address as a GitHub Secret in your repository with the name
OLLAMA_ADDRESS
. You can find more information about GitHub Secrets here. -
Create a
.github/workflows/code_review.yaml
file in your repository and add the following content:
name: Code Review with ollama
on:
pull_request:
types:
- opened
- synchronize
permissions: write-all
jobs:
code_review:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Code Review
uses: tomisacat/ai_code_review@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OLLAMA_ADDRESS: ${{ secrets.OLLAMA_ADDRESS }}
exclude: "yarn.lock,dist/**"
-
Customize the
exclude
input if you want to ignore certain file patterns from being reviewed. -
Commit the changes to your repository, and
ai_code_review
will start working on your future pull requests.
The ai_code_review
GitHub Action retrieves the pull request diff, filters out excluded files, and sends code chunks to
the Ollama's REST API. It then generates review comments based on the AI's response and adds them to the pull request.
Contributions are welcome! Please feel free to submit issues or pull requests to improve the ai_code_review
GitHub
Action.
Let the maintainer generate the final package (yarn build
& yarn package
).
This project is licensed under the MIT License. See the LICENSE file for more information.