agentusecasesAll 965 use cases
Software & DevOps

Review GitHub pull requests automatically

An n8n AI agent triggers on each new PR, fetches diffs, calls an LLM for a review, and posts comments and labels back on the PR.

Done withn8n

What they did
A GitHub Trigger node in n8n fires when a PR is opened. An HTTP Request node calls GitHub's pull request files API, and a Code node merges each filename and diff into a prompt that casts the model as a senior iOS developer. The agent runs on an OpenAI chat model and reads a Google Sheet of team Swift best practices as a tool. GitHub nodes then post the comment and add a ReviewedByAI label.
How it went
In a test PR adding iota cryptocurrency support, the agent posted a comment and applied the label. The comment was one general comment, not line-level. Reviews were often too verbose and could miss the core problems.
Worth knowing
Validate each node's output as you build it. Inline comments would need a loop over each file's diff and line numbers, which the author lists as a next step and did not build.

Try it yourself with n8n

Build an n8n workflow triggered when a new pull request opens in my GitHub repo [owner/repo]. It should fetch the diff, ask an AI model to review it for bugs, readability and missing tests, then post the review as a comment and add a label such as [label names]. You're done when a test PR gets a useful review comment; pause and show me the comment and label before anything is posted to GitHub.

Read the original ↗

Source: medium.com · Undated

Five of these in your inbox every morning

The best things people got an AI agent to do, each with the prompt to try it.

More like this