yamllint "truthy value should be one of [false, true]" in CI
yamllint's truthy rule wants booleans written canonically as true or false. Legacy YAML booleans (yes, no, on, off, True) trigger "truthy value should be one of [false, true]".
What this error means
yamllint reports "truthy value should be one of [false, true] (truthy)" on a value like yes, on, or a capitalized True. This also warns about the GitHub Actions on: key.
yamllint
workflow.yml
1:1 warning truthy value should be one of [false, true] (truthy)
9:14 error truthy value should be one of [false, true] (truthy)Common causes
A non-canonical boolean literal
YAML 1.1 treats yes/no/on/off as booleans; the truthy rule wants them normalized to true/false.
The GitHub Actions "on:" key looks truthy
The reserved on: trigger key is read as the boolean on, so the rule flags line 1 of every workflow unless configured.
How to fix it
Use canonical booleans
- Replace
yes/no/on/off/Truewithtrueorfalse. - Quote intentional string values like
"on"if they must stay strings. - Re-run
yamllintto confirm.
workflow.yml
# wrong
enabled: yes
# right
enabled: trueAllow the Actions "on" key in config
Add on to check-keys exclusions (or set allowed-values) so workflow trigger keys do not warn.
.yamllint
rules:
truthy:
allowed-values: ['true', 'false']
check-keys: falseHow to prevent it
- Standardize on
true/falseeverywhere in YAML. - Configure the truthy rule to ignore the Actions
on:key. - Quote strings that happen to spell booleans.
Related guides
yamllint "duplication of key" error in CIFix yamllint "duplication of key \"X\" in mapping (key-duplicates)" in CI - the same key appears twice in one…
GitHub Actions "Invalid workflow file ... error in your yaml syntax" in CIFix GitHub Actions "Invalid workflow file ... You have an error in your yaml syntax on line N" - the workflow…
yamllint "line too long" error in CIFix yamllint "line too long (N > 80 characters) (line-length)" in CI - a line exceeds the configured max leng…