Skip to content

Commit aab2eb8

Browse files
committed
docs: address review feedback - trim explanations, update model
1 parent 1b0eade commit aab2eb8

1 file changed

Lines changed: 8 additions & 14 deletions

File tree

docs/use-cases/ci-cd.mdx

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The AI-powered CI/CD workflow follows this pattern:
1313
1. **A pull request is opened or updated** — GitHub Actions triggers a workflow
1414
2. **The workflow creates an E2B sandbox** — a fresh Linux environment isolated from the CI runner
1515
3. **The repository is cloned into the sandbox** — the PR branch is checked out using E2B's [git integration](/docs/sandbox/git-integration)
16-
4. **An LLM analyzes the changes** — the diff is sent to a language model (e.g., OpenAI GPT-4o, Anthropic Claude) for review or test generation
16+
4. **An LLM analyzes the changes** — the diff is sent to a language model (e.g., OpenAI ChatGPT 5.2 Mini, Anthropic Claude) for review or test generation
1717
5. **Tests run inside the sandbox** — the project's test suite executes in isolation, with output streamed back to the workflow
1818
6. **Results are reported** — the workflow posts findings as PR comments via the GitHub API
1919

@@ -126,7 +126,7 @@ const diffResult = await sandbox.commands.run(
126126

127127
const openai = new OpenAI()
128128
const response = await openai.chat.completions.create({
129-
model: 'gpt-4o',
129+
model: 'gpt-5.2-mini',
130130
messages: [
131131
{
132132
role: 'system',
@@ -216,7 +216,7 @@ diff_result = sandbox.commands.run(
216216

217217
client = OpenAI()
218218
response = client.chat.completions.create(
219-
model="gpt-4o",
219+
model="gpt-5.2-mini",
220220
messages=[
221221
{
222222
"role": "system",
@@ -271,17 +271,11 @@ print("Done")
271271
```
272272
</CodeGroup>
273273

274-
### What the script does
275-
276-
**Step 1 — Create a sandbox.** `Sandbox.create()` spins up a fresh Linux environment via the E2B API. The `timeoutMs` / `timeout` sets a 5-minute auto-destroy limit so forgotten sandboxes don't run up costs.
277-
278-
**Step 2 — Clone the PR branch.** `sandbox.git.clone()` clones the repository inside the sandbox, not on the CI runner. The `GITHUB_TOKEN` provided by GitHub Actions authenticates the clone when paired with `x-access-token` as the username — this is the standard [GitHub Apps authentication pattern](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation). `depth: 1` makes it a shallow clone for speed.
279-
280-
**Step 3 — AI code review.** `sandbox.commands.run()` executes `git diff` inside the sandbox and returns the output in `stdout`. The diff is then sent to an LLM (OpenAI GPT-4o in this example) with a system prompt asking for a code review. You can swap this for any model or provider — see [Connect LLMs](/docs/quickstart/connect-llms).
281-
282-
**Step 4 — Run tests.** The test suite runs inside the sandbox with `onStdout` / `on_stdout` callbacks that stream output in real time to the GitHub Actions logs. The `commands.run()` method throws when a command exits with a non-zero code — `CommandExitError` in JavaScript, `CommandExitException` in Python — so test failures are caught with try/catch and cause the workflow to fail.
283-
284-
**Step 5 — Post results.** The review is posted as a PR comment via the [GitHub REST API](https://docs.github.com/en/rest/issues/comments#create-an-issue-comment). The `GITHUB_TOKEN` has write access thanks to the `permissions` block in the workflow. Finally, `sandbox.kill()` destroys the sandbox immediately rather than waiting for the timeout.
274+
1. **Create sandbox**`Sandbox.create()` spins up an isolated Linux environment with a 5-minute timeout
275+
2. **Clone the PR**`sandbox.git.clone()` checks out the PR branch using `x-access-token` + `GITHUB_TOKEN` for [authentication](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation)
276+
3. **AI review** — runs `git diff` inside the sandbox, sends the output to an LLM — swap the model for any provider via [Connect LLMs](/docs/quickstart/connect-llms)
277+
4. **Run tests**`commands.run()` streams output in real time and throws on failure (`CommandExitError` / `CommandExitException`)
278+
5. **Post results** — comments the review on the PR via the GitHub REST API, then destroys the sandbox
285279

286280
## Related Guides
287281

0 commit comments

Comments
 (0)