Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Codex GitHub Integration

Codex GitHub Integration

Codex integrates deeply with GitHub, allowing code review directly in pull requests. This section explains in detail how to configure and use GitHub integration.


Feature Overview

With GitHub integration, you can:

Without leaving GitHub, Codex replies to review comments just like a teammate.


Setting Up GitHub Integration

Precondition

Configuration steps

  1. Settings Codex Cloud
  2. Go to Codex settings
  3. Enable for the repository Code review Function
  4. Authorize Codex to access your repositories

You need to grant Codex permission to read repositories and create pull requests.


Request a code review

Trigger a Review Manually

Mention in a pull request comment @codex review:

Request a review

Enter in a PR comment:

@

codex review

Or specify review focus

@

codex review

for

security regressions

Codex Response

Codex will:

  1. React to the PR (👀)
  2. Analyze code changes
  3. Publish review comments
  4. Flag issues found (P0 and P1)

Codex posts review comments on the PR just like a human reviewer.

Automatic Review

Enable in settings Automatic reviews:

  1. Go to Codex settings
  2. Enable Automatic reviews
  3. Automatically publish a review when a new PR is opened

Customize Review Content

Set repository review guidelines

In the repository's AGENTS.md add review guidelines:

Add Review Guidelines

Review guidelines

Don't log PII

(

Personally Identifiable Information

)

Verify that authentication middleware wraps every route

Check for SQL injection vulnerabilities

Ensure error messages don't leak sensitive information

Module-specific rules

Place more specific review rules in subdirectories:

Module-specific rules

src/payment/ module review rules

Payment-specific reviews

Verify payment processing follows PCI compliance

Check for proper amount validation

Ensure transaction logging

More specific rules automatically apply to code changes in the corresponding module.

One-time Review Focus

Specify review focus in a comment:

Specify Review Focus

Comment Example

@

codex review

for

security issues

@

codex review

for

performance regressions

@

codex review

for

documentation completeness


Give Codex Other Tasks

Mention in a comment @codex(not review) starts a cloud task:

Other Tasks

Fix CI failures

@

codex fix the CI failures

Add tests

@

codex add tests

for

the new API endpoints

Refactor code

@

codex refactor this

function

to use async

/

await

Using Codex's other features is as simple as @-mentioning it in a comment.


GitHub Actions integration

You can also use Codex in GitHub Actions:

GitHub Actions Workflow

span style="color: green;">

name

:

Codex Review

on

:

[

pull_request

]

jobs

:

  codex-review

:

    runs-on

:

ubuntu-latest

    steps

:

      - uses

:

actions/checkout@v4

      - name

:

Run Codex Review

        run

: |

         codex exec "Review code changes in this PR" --output review.md

      - name

:

Post Review

        uses

:

actions/github-script@v7

        with

:

          script

: |

           const fs = require('fs');
            const review = fs.readFileSync('review.md', 'utf8');
            github.rest.pulls.createReview({
              owner: context.repo.owner,
              repo: context.repo.repo,
              pull_number: context.issue.number,
              body: review,
              event: 'COMMENT'
            });

Integrating Codex into CI/CD pipelines automates code review.


Best Practices

Review Guidelines

Automation

Good configuration makes Codex's reviews more accurate and efficient.


Common questions

Q: Does Codex review require payment?

GitHub integration requires a Codex Cloud subscription.

Q: Can Codex access private repositories?

You need to authorize Codex to access your private repositories.

Q: Can you limit which repositories Codex reviews?

Yes, you can selectively authorize repositories in settings.

Q: Which severity levels of issues does Codex flag?

By default, it flags P0 (critical) and P1 (important) issues.