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

Each integration step this workflow runs, in order, what it is for, and the conditions and loops that decide when it runs.

  1. For each pullRequest

    1. 1OpenAIQuery modelAsks the AI to list what is plainly visible in the diff: missing error handling, unclear names, untested behaviour and obvious risks.
    2. 2GitHubCreate commentPosts the points as a comment on the pull request, noting how many changed files were read and that nothing is approved.
    3. 3GitHubAdd label to issueAdds the 'first-pass-reviewed' label to the pull request after commenting, so later runs skip it until the label is removed.

How it works

What happens on each run, in plain English.

Every hour, the open pull requests in one GitHub repository are checked and each one not yet reviewed gets a first pass: its changed files are fetched, the AI is asked to note what is plainly visible in the diff, such as missing error handling, unclear names or new behaviour without a test, and those points are posted as a comment.

The reviewer starts from something rather than nothing. The comment says it is a first pass, and nothing is ever approved, merged or closed. Each pull request is reviewed once: after commenting, a label is added and anything carrying it is skipped, so a re-run never posts the same review twice; remove the label to have it looked at again. Drafts are left alone, and on a large pull request only the first batch of changed files is read, with the comment stating how many it covers.

You need a GitHub token that can read the repository, since the changed files are read from GitHub's API directly, and the label must already exist in the repository.

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