Skip to content
Latchkey

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

  1. Replace yes/no/on/off/True with true or false.
  2. Quote intentional string values like "on" if they must stay strings.
  3. Re-run yamllint to confirm.
workflow.yml
# wrong
enabled: yes
# right
enabled: true

Allow 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: false

How to prevent it

  • Standardize on true/false everywhere in YAML.
  • Configure the truthy rule to ignore the Actions on: key.
  • Quote strings that happen to spell booleans.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →