On GitHub Actions, a readerly command prints the text report without color or prompts, and writes workflow commands on stderr so the pull request marks the lines. createOut does this when it detects the runner. You call nothing.
Detection
Section titled "Detection"detect() reads GITHUB_ACTIONS from the environment and returns reader: "ci" with ci: { name: "github-actions" }. The runner sets the variable on every job. A CI set to 0, false, no or off turns CI detection off, see the CI table.
The profile for that run, from resolveProfile with no flags:
| Field | Value | profile.why |
|---|---|---|
format | text | detected ci (CI:github-actions) |
color | false | stdout is not a TTY |
interactive | false | reader is ci |
budget | Infinity | no budget for ci on text |
annotations | "github" |
profile.annotations is "github" only when the reader is ci, the provider is github-actions and the format is text. --format json, --format jsonl and --json turn annotations off. Annotations are a side channel next to text, not a format.
What the runner prints
Section titled "What the runner prints"The acme check example from test/golden/check.ts exits 1. On stdout, GitHub Actions gets:
✖ 2 errors, 1 warning in 212 files (0.8s)
error ACME001 src/app.ts:14:3 Route handler reads process.env at module scope
├▶ why: The value is fixed at build time
╰▶ fix: Read it inside the handler
error ACME004 src/db.ts:3:1 Top-level await in a server entry
╰▶ fix: Move the call into the plugin setup
warn ACME010 vite.config.ts:8:5 Alias shadows a workspace package
next: acme check --fix (applies 2 safe fixes)
next: acme explain <code> (explains one code)The command asks "Apply 2 safe fixes?" at a terminal. In CI nobody can answer, so out.confirm takes its default and adds the next: acme check --fix line instead. The row cap is off in CI, so every finding prints.
On stderr, GitHub Actions gets:
::error title=ACME001,file=src/app.ts,line=14,col=3::Route handler reads process.env at module scope
::error title=ACME004,file=src/db.ts,line=3,col=1::Top-level await in a server entry
::warning title=ACME010,file=vite.config.ts,line=8,col=5::Alias shadows a workspace packageAnnotations go to stderr so acme check > report.txt keeps the file free of workflow commands, and the runner still reads them.
githubAnnotations
Section titled "githubAnnotations"The text renderer calls githubAnnotations from readerly/github. A custom renderer or another tool can call it too. It takes DiagnosticRecords and a cap, 10 by default, returns one line per annotation, and prints nothing itself:
import type { DiagnosticRecord } from "readerly";
import { githubAnnotations } from "readerly/github";
const records: DiagnosticRecord[] = [
{
severity: "error",
code: "ACME020",
message: "Port 3000:3001 is taken, 100% of the time",
docs: "https://acme.dev/codes/ACME020",
file: "src/a,b.ts",
line: 2,
column: 7,
},
{ severity: "warn", message: "No file, so no annotation" },
{ severity: "info", message: "Infos never get one", file: "src/app.ts" },
];
process.stderr.write(githubAnnotations(records));It writes one line:
::error title=ACME020,file=src/a%2Cb.ts,line=2,col=7::Port 3000:3001 is taken, 100%25 of the time%0Ahttps://acme.dev/codes/ACME020- Errors become
::errorand warnings::warning. Infos and records without afileare skipped and don't use up the cap. - The cap counts each kind on its own, in input order: at most 10 errors and 10 warnings.
titleis thecode, then comefile,lineandcol. A range on one line addsendLineandendColumn. A range over several lines giveslineandendLineonly.docsgoes on a second line of the message.- Messages escape
%,\rand\n. Property values also escape:and,.
A workflow step
Section titled "A workflow step"A readerly CLI needs no flag on the runner:
name: check
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- run: npm ci
- run: npx acme checkThe step fails when acme check exits 1, and the pull request shows each annotation on its line.
Coding agents in CI
Section titled "Coding agents in CI"An agent that runs on a runner reads the output, so it gets the agent format. AI_AGENT and strong markers such as CLAUDECODE win over CI. Weak markers never do. With AI_AGENT=claude-code and GITHUB_ACTIONS=true, acme check prints the same compact report an agent gets on a laptop, byte for byte, and nothing on stderr. Annotations need text. See coding agents for the markers.