GitHub Actions "Unable to interpret 'X' as boolean"
Keys such as continue-on-error and a workflow_dispatch boolean input expect a real boolean. An expression that evaluates to an arbitrary string (for example the literal text "true ") fails strict boolean coercion.
What this error means
A boolean-typed key fails with a message naming the offending value, usually after an input or expression produced a quoted or padded string instead of true/false.
github-actions
Error: Unable to interpret 'yes' as a boolean.Common causes
Expression returns a string, not a boolean
An input default like 'true' is a string; some keys reject it where a literal true is required.
Non-boolean literal supplied
Values like yes/no/1/0 are not booleans to the expression engine.
How to fix it
Produce a real boolean expression
- Compare to get a boolean: \${{ inputs.flag == 'true' }}.
- Declare workflow_dispatch inputs with type: boolean so they arrive as true/false.
- Avoid quoting boolean literals in keys that expect them.
.github/workflows/deploy.yml
on:
workflow_dispatch:
inputs:
deploy:
type: boolean
default: false
jobs:
ship:
if: ${{ inputs.deploy }}
runs-on: ubuntu-latest
steps:
- run: echo "deploying"How to prevent it
- Use type: boolean for dispatch inputs that gate jobs or steps.
- Coerce strings to booleans with an explicit == comparison.
Related guides
GitHub Actions if condition always runs (string vs expression)Fix a GitHub Actions if condition that always runs - a bare string in if is truthy, so the step never skips.
GitHub Actions secrets cannot be used in if conditionsFix GitHub Actions where secrets in an if condition do not work - the secrets context is not available in job…