30.7 Claude in CI and the release pipeline
- Approved by
- Panaversity ·
In everyday life. A post office will not send a parcel with an empty address line, however urgent the sender says it is. The clerk checks every line against the form, at nine in the morning and at closing time alike. The clerk does not open the parcel or judge what is inside. The clerk checks only that every line is filled and that the ZIP code matches the town. In this section, the parcel is a pull request, the address lines are the table's cells, and the clerk is a required check.
What you will learn. You practice this in Lab 30, Tasks 0 and 4.
- Which checks must pass before a change reaches staging?
- What does
check:environmentscatch that the suite cannot? - How does Claude Code run in a pipeline?
- Which two traps does the GitHub Action hold?
- Which model does CI's review job use?
Why it matters. This is how you find out before Ana does. A release pipeline is the path every change takes from a pull request to production. Its first gate is the pull request's checks, the only place a fault can be caught before any environment runs the change.
At work. It is Tuesday, May 18, 2027, just after 10:00 a.m. Your pull request is open. Its checks run, and so does CI's review job, which runs Claude Code on the change. The review's log names a model that .claude/settings.json does not name. Nobody changed that file. You want to know why.
Which checks must pass before a change reaches staging?
Every check a machine can run on the change, made required, and none of them holding a key. That is 15.7's rule: "make every check a machine can run a required check". A required check is one the branch's rule names, so a merge waits until it passes. Brightline's pull request now runs these four, beside Lab 15's tests-unchanged and no-secrets:
| The check | What it reads | What it catches | From |
|---|---|---|---|
checks | The code | Type errors and failing tests | Lab 15 |
check:agent-config | agents/, environments/, deployments/ | An agent file that breaks the worker's rules | Lab 23 |
| The suite on replay, and live when the prompt, the model or the golden set changes | The golden set and recorded answers | A wrong answer, below the written threshold (24.3) | Lab 24 |
check:environments | docs/environments.md and the files its proofs name | An empty cell in a row the change touched, and a cell its file disagrees with | Lab 30 |
The first, second and fourth read files only. They need no model and no key, as Lab 23's pull-request job gets "no platform token at all" (Lab 23, Task 13). The suite's live job does call a model.
What does check:environments catch that the suite cannot?
A value that is right in one environment and wrong in another. The suite runs the code on its cases, in one place, with one key. It cannot see production's workspace, or a fallback model that never ran. check:environments reads the table and the files its proofs name, and compares them. On Tuesday it caught two such values (30.3, 30.4).
It has a limit. A cell proved "by a person" is only listed, never compared.
How does Claude Code run in a pipeline?
Headless, with claude -p, and its exit code decides the step. Running with nobody watching, and the output formats a program reads, are 12.7 and 12.8. For a pipeline, one more fact matters. Anthropic's page says "Claude Code exits with code 0 on success and a non-zero code when the run fails". So a CI step fails when the run fails.1
12.7 also warned: "a seat does not always load them … So check that each seat loads the rules and settings you intend." A CI job is a seat. What it loads is a cell in row 5.
Which two traps does the GitHub Action hold?
A prompt input sends the answer to the log, and Claude's commits made with the default token start no checks. Anthropic's GitHub Action, anthropics/claude-code-action@v1, runs Claude Code inside a GitHub workflow.2
- The answer goes to the log. Without a
promptinput, Claude waits for an@claudemention and answers in a comment. With one, it runs in automation mode. "When the workflow provides apromptinput, Claude runs without waiting for a mention." And "By default, results appear in the workflow run log rather than a comment."2 A review job that gives a prompt and expects comments may post nothing that a reviewer sees. Tell it in the prompt to post, and give it a tool that can. - Claude's commits start no checks. "GitHub doesn't trigger workflows on commits made with the default
GITHUB_TOKEN."2 If Claude pushes a fix to your branch with that token, your required checks do not run on its commit. Anthropic's fix: leavegithub_tokenout, so the Action signs in as the Claude GitHub App, "or pass a custom app token instead".2
AI review on every pull request, and what its findings are worth, is 15.6.
Which model does CI's review job use?
The one its --model flag names, whatever the settings file says. The Action passes Claude Code's flags in its claude_args input, and --model is one of them.2 Brightline's review job sets it there. In Claude Code's model order, --model at startup comes before the settings file's model.3 So the review ran on the workflow's model, not on the one .claude/settings.json names. Without --model, the Action uses Claude Code's default model.2
That is not wrong. It is a value that differs by place. Write it in row 5's staging cell, with the workflow's claude_args line as its proof, so the next person who reads the log knows why.
The operating rule: make the table's check a required check beside the suite, and give the pull request's checks no key. Write every value CI sets for itself into row 5.
Do this now. Ask your coding agent to show your pipeline's gates. Copy this line:
List every workflow in .github/workflows. For each job, say when it runs, whether it is a required check on main, whether it holds a key or a token, and which model it uses and where that is set. Mark any Claude Code step with a prompt input, and say where its output goes. Mark any step that passes the default GITHUB_TOKEN to it. Change no file.
Check yourself
Question 1 / 6
0 answered
Of the four checks in this section's table, which one calls a model?
Sources
- Owner
- Panaversity