All workflows
OpenAI logoGitHub logo

AI first-pass review on open pull requests

Reads the diff of each open pull request, has AI note the obvious problems, and posts them as a comment.

Every hour2 apps3 steps

Apps it connects

Authenticate each one once and the workflow is ready to run.

What it does

The integration steps this workflow runs, in the order it first runs them.

  1. 1OpenAIQuery model
  2. 2GitHubCreate comment
  3. 3GitHubAdd label to issue

How it works

Everything the template sets up, and what to fill in before the first run.

Every hour this workflow looks at the open pull requests in one GitHub repository and gives each new one a first-pass read: it fetches the changed files, asks a model to note what is plainly visible in the diff - error handling that looks missing, names that do not say what the thing is, new behaviour arriving without a test - and posts those points as a comment, so the human reviewer starts from something rather than from nothing.

It never approves, merges or closes anything. The comment is a starting point and says so; every decision stays with the reviewer.

A pull request is reviewed once. After commenting, the workflow adds the label named in the 'reviewedLabel' step (default 'first-pass-reviewed'), and skips anything already carrying it - so a re-run never posts the same review twice. Remove the label to have a pull request looked at again. Drafts are left alone.

Large pull requests are handled openly rather than quietly cut off: only the first 'maxFilesPerReview' changed files are read, each file's diff is shortened at 'maxDiffCharactersPerFile', and the comment states how many of the changed files the review actually covers. 'maxPullRequestsPerRun' caps how many pull requests one run will comment on, so the first run on a busy repository does not fire off dozens of model calls at once.

To set it up, fill in 'repositoryOwner' and 'repositoryName', and paste a GitHub token that can read the repository into 'repositoryReadToken' - Lodol has no built-in step for reading a pull request's changed files, so this workflow calls GitHub's API directly for that part and needs a token of its own; read-only access is enough. Connect GitHub and OpenAI for the comment, the label and the review itself. If the label does not exist in the repository yet, add it once in the repository's Labels settings.

githubpull requestcode reviewopenaiaihourly

Start from a workflow that already works.

Add "AI first-pass review on open pull requests" to your workspace, connect its apps, and make it yours. No credit card required.

Free plan available · No credit card required