Recipes / Dev & code
CodexFull setupDev & code

Your own PR review bot with Codex

OpenAI's action runs Codex CLI inside a workflow with locked-down privileges; the README's example posts a code review comment on each new PR.

From openai on GitHub · Oct 2025

Setup time15 min
CostAPI usage
RunsOn PR opened
NeedsGitHub Actions, OpenAI API key (secret)
Last updated2026-10-17

What the source did

  • Installs Codex CLI and routes calls through a secure proxy.
  • Example workflow: shallow clone, fetch base and head, run Codex with a PR-specific prompt, post the output as a comment.

Summary written by Agent Cookbook. See the original for the full context.

Get their template

Made and published by openai. Start here; it is their original, not ours.

Their prompt

From OpenAI's README Their exact wording: the prompt in the example review workflow. Source ↗

This is PR #${{ github.event.pull_request.number }} for ${{ github.repository }}. Review ONLY the changes introduced by the PR, so consider: git log --oneline ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} Suggest any improvements, potential bugs, or issues. Be concise and specific in your feedback. Pull request title and body: ---- ${{ github.event.pull_request.title }} ${{ github.event.pull_request.body }}

Approval rule

🛡
Workflow gets contents: read; only the comment step can write.

Set it up

  1. Add the key as a secret.
  2. Copy the README example workflow.
  3. Start from their example prompt above, then add your repo's own review rules.
  4. Read the repo's security doc and keep permissions read-only.

Common failures

⚠
  • Noisy nitpicks. Tell it to report only real problems.
  • Forked PRs can't read secrets by default; that's intended.

Variations

  • Run on a label instead of every PR.
  • Pair with the Claude action and compare reviews.

Get the 10 best agent setups. Free.

Plus new recipes every week. One email, no spam.

Unsubscribe anytime. Privacy

Related recipes

Get their template ↗