Skip to content

Commit c97819a

Browse files
committed
add a typo to test AGENTS.md
1 parent cb42505 commit c97819a

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

examples/codex/build_code_review_with_codex_sdk.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ With [Code Review](https://chatgpt.com/codex/settings/code-review) in Codex Clou
44

55
Luckily, we can replicate Codex's cloud hosted review process in our own CI/CD runners. In this guide, we'll build our own Code Review action using the Codex CLI headless mode with both GitHub Actions and Jenkins.
66

7-
To build our own Code review, we'll take the following steps:
7+
To build our own Code review, we'll take the following stps:
8+
89
1. Install the Codex CLI in our CI/CD runner
9-
1. Prompt Codex in headless (exec) mode with the Code Review prompt that ships with the CLI
10-
1. Specify a structured output JSON schema for Codex
11-
1. Parse the JSON result and use it to make API calls to our SCM to create review comments
10+
2. Prompt Codex in headless (exec) mode with the Code Review prompt that ships with the CLI
11+
3. Specify a structured output JSON schema for Codex
12+
4. Parse the JSON result and use it to make API calls to our SCM to create review comments
1213

1314
Once implemented, Codex will be able to leave inline code review comments:
14-
<img src="../../images/codex_code_review.png" alt="Codex Code Review in GitHub" width="500"/>
15+
`<img src="../../images/codex_code_review.png" alt="Codex Code Review in GitHub" width="500"/>`
1516

1617
## The Code Review Prompt
18+
1719
GPT-5-Codex has received specific training to improve its code review abilities. You can steer GPT-5-Codex to conduct a code review with the following prompt:
1820

1921
```
@@ -25,7 +27,9 @@ Prioritize severe issues and avoid nit-level comments unless they block understa
2527
After listing findings, produce an overall correctness verdict (\"patch is correct\" or \"patch is incorrect\") with a concise justification and a confidence score between 0 and 1.
2628
Ensure that file citations and line numbers are exactly correct using the tools available; if they are incorrect your comments will be rejected.
2729
```
30+
2831
## Codex Structured Outputs
32+
2933
In order to make comments on code ranges in our pull request, we need to receive Codex's response in a specific format. To do that we can create a file called `codex-output-schema.json` that conforms to OpenAI's [structured outputs](https://platform.openai.com/docs/guides/structured-outputs) format.
3034

3135
To use this file in our workflow YAML, we can call Codex with the `output-schema-file` argument like this:
@@ -50,7 +54,9 @@ codex exec "Review my pull request!" --output-schema codex-output-schema.json
5054
```
5155

5256
## GitHub Actions Example
57+
5358
Let's put it all together. If you're using GitHub Actions in an on-prem environment, you can tailor this example to your specific workflow. Inline comments highlight the key steps.
59+
5460
```yaml
5561
name: Codex Code Review
5662
@@ -331,6 +337,7 @@ jobs:
331337
```
332338

333339
## Jenkins Example
340+
334341
We can use the same approach to scripting a job with Jenkins. Once again, comments highlight key stages of the workflow:
335342

336343
```groovy
@@ -650,5 +657,7 @@ pipeline {
650657
}
651658
}
652659
```
660+
653661
# Wrap Up
662+
654663
With the Codex SDK, you can build your own GitHub Code Review in on-prem environments. However, the pattern of triggering Codex with a prompt, receiving a structured output, and then acting on that output with an API call extends far beyond Code Review. For example, we could use this pattern to trigger a root-cause analysis when an incident is created and post a structured report into a Slack channel. Or we could create a code quality report on each PR and post results into a dashboard.

0 commit comments

Comments
 (0)