CoercionMode
type CoercionMode = "off" | "warn" | "fix";Defined in: packages/core/src/coercion.ts:27
YAML 1.1 coercion-trap predicate (#137).
Actio parses .actio.yml with the YAML 1.2 core schema, so author tokens like
no, on, 1:30, 2024-01-01, 1_000 survive parsing as JS strings, and
the emitter writes them back unquoted. A downstream YAML 1.1 consumer then
re-reads those plain tokens with the older schema and coerces them (no→false,
1:30→90, 2024-01-01→a date, 1_000→1000). This predicate flags exactly the
strings a 1.1 consumer would mis-type so the emitter can defensively quote them.
Scope, honestly: the GitHub Actions workflow parser largely preserves these
as strings in string positions and rejects an unquoted trap loudly in typed
positions (it does not silently rewrite your file). The live 1.1 footguns are
elsewhere — per-action action.yml input parsing, the truthy on: key, and
downstream tooling that reads the generated YAML. So this is defensive
hardening against 1.1 consumers, not a claim about the runner's own parser.
The catalog is deliberately narrow: it covers only the categories where
yaml-core (1.2) emits the string PLAIN and a 1.1 consumer corrupts that
plain token. Everything else (true/false, null, octal/hex without
separators, floats, scientific notation, big ints) is already emitted
quoted-or-numeric by yaml-core, so a 1.1 consumer reads it identically —
quoting those would only churn the output. Genuine JS booleans/numbers never
reach this predicate because the caller guards on typeof value === "string".