1b3232b10c63c82dc7a3c7a2bd4337de0a55881d
Table of Contents
About
Automated code reviewer that uses AI to analyze git diffs and provide inline comments on pull requests. Supports Anthropic, OpenAI, and Ollama models with tool-based reviewing for precise feedback.
Built With
Setup
Production
Instructions
- Add the following git action:
name: Code review
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
review:
runs-on: ubuntu-latest
container: docker
steps:
- name: Fetch code
run: |
git clone "$(echo ${{github.server_url}}/${{github.repository}}.git | sed s%://%://${{github.token}}@% )" .
git checkout ${{ github.event.pull_request.head.sha }}
git fetch origin ${{ github.event.pull_request.base.ref }}
- name: Run AI Review
run: |
REGISTRY="$(echo "${{github.server_url}}" | sed -E 's|https?://||')"
docker login -u "${{github.repository_owner}}" -p "${{secrets.DEPLOY_TOKEN}}" "$REGISTRY"
docker pull "$REGISTRY/ztimson/ai-reviewer:test"
docker run --rm \
-v $(pwd):/github/workspace \
-e AI_HOST=anthropic \
-e AI_MODEL=claude-sonnet-4-5 \
-e AI_TOKEN="${{ secrets.ANTHROPIC_TOKEN }}" \
-e GIT_HOST="${{ github.server_url }}" \
-e GIT_OWNER="${{ github.repository_owner }}" \
-e GIT_REPO="${{ github.event.repository.name }}" \
-e GIT_TOKEN="${{ secrets.ASSISTANT_TOKEN }}" \
-e GIT_BRANCH="origin/${{ github.event.pull_request.base.ref }}" \
-e PULL_REQUEST="${{ github.event.pull_request.number }}" \
"$REGISTRY/ztimson/ai-reviewer:test"
Development
Prerequisites
Instructions
- Install the dependencies:
npm i - Build library:
npm run review
License
Copyright © 2025 Zakary Timson | All Rights Reserved | Available under MIT Licensing
See the license for more information.
Languages
JavaScript
100%