Auto-review GitHub pull requests with n8n
They used an n8n workflow to inspect new GitHub pull requests, generate a review with an LLM, and post feedback back to the PR.
- What they did
- A GitHub trigger in n8n started the workflow whenever someone opened a pull request. The flow then pulled the changed files from GitHub, combined each filename with its diff in a Code node, and sent that context to an OpenAI chat model framed as a senior iOS developer. It also used a Google Sheet of Swift style rules as a reference before GitHub nodes added a review comment and a ReviewedByAI label.
- How it went
- In a test pull request that added iota cryptocurrency support, the agent left one overall comment and added the label. The review was useful as a first pass, but it tended to be wordy and could overlook the main issues.
- Tips
- Check the output of each node as you assemble the workflow. If you want file-by-file inline remarks, plan for a loop that handles each diff and its line numbers.
Try it yourself with n8n
Set up an n8n workflow for my GitHub repo [owner/repo] that starts when a new pull request is opened. Fetch the changed files and diffs, compare them with these team rules: [paste guidelines], and ask an AI model to review the code for bugs, readability, and missing tests. Draft a single PR comment and suggest a label like [label name]. Before anything is posted, stop and show me the exact comment and label for approval. If I approve, then post the comment and apply the label to the pull request.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
2 more reports of this
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Set up an alert-diagnosis workflow for Kubernetes incidents
An n8n flow takes Alertmanager alerts, checks several MCP-connected systems, and writes a read-only diagnostic reply in Mattermost.
Repair a broken API site with step-by-step review
A developer used Claude Cowork to inspect an API site, explain the trouble, and make direct code fixes after another agent kept making things worse.
Build a homepage from Figma in Cursor with MCP
A developer linked Figma to Cursor through MCP and used it to turn a design slice into homepage code.
Use ChatGPT to narrow down Swift error causes
A Swift developer pastes an error and nearby code into ChatGPT to get a quick first guess, then checks the output before changing anything.
Build internal real estate tools with Codex
A rental owner used Codex to make custom tools for offer pricing, property reports, and contract tracking.
Build a lean skill layer from CLI help output
A developer swapped token-heavy Jira and GitLab MCPs for Markdown-based skills generated from the Atlassian and GitLab CLIs.