Automated code review is one of the few AI workflows that pays for itself on the first pull request, and you can run it entirely on a free model allowance if you design the pipeline around the model's limits rather than against them. I built a GitHub Actions workflow that calls the open source MonkeyCode project's free model access to comment on pull requests, and the result is a reviewer that catches real issues without spamming the conversation. Disclosure: This article was prepared as part of MonkeyCode's product outreach.

The open source MonkeyCode project offers a free model allowance of ten million tokens and a free server option at the time of writing, and while the server is not required for this pipeline, it becomes useful if you later want to move the same logic to a hosted webhook. The setup is deliberately simple because the value is in the workflow, not in the model. The workflow triggers on pull_request events, checks out the repository with full history, and then passes a unified diff to a Python script that asks the model for structured feedback.

The Workflow

The first step is a workflow file that captures the diff between the base branch and the head branch. Using fetch-depth: 0 ensures that git can compute the exact changes, and the diff is saved to a temporary file that the review script can read. The environment variables carry the API key and the GitHub token, so no secrets appear in the repository.