GitHub Actions "Invalid type" for env or with values
An env or with value must be a scalar (string, number, or boolean). Supplying a nested list or mapping is rejected.
What this error means
The workflow fails validation with a message that the value has an invalid type, pointing at an env or with entry.
github-actions
The workflow is not valid. .github/workflows/ci.yml (Line: 12): Invalid type found: 'sequence' for 'with' valueCommon causes
A list passed as a single input
with: inputs are scalars. To pass multiple values, join them into a string or multi-line string the action expects.
A mapping where a string was expected
Indenting child keys under an env var turns it into a mapping, which env cannot hold.
How to fix it
Flatten the value to a scalar
- Convert lists to a delimited or multi-line string.
- Quote values to force string type when needed.
.github/workflows/ci.yml
with:
args: "--flag-a --flag-b"
env:
PATHS: |
src
testHow to prevent it
- Check each action README for the expected input format.
- Run actionlint to catch type mismatches.
Related guides
GitHub Actions "Unexpected value" at a specific workflow lineFix the GitHub Actions "The workflow is not valid ... (Line: N): Unexpected value" error caused by a key in t…
GitHub Actions "Unable to interpret value as a boolean"Fix the GitHub Actions error "Unable to interpret value as a boolean" caused by passing a string expression w…
GitHub Actions "Invalid format" for timeout-minutesFix the GitHub Actions invalid format error for timeout-minutes caused by a non-numeric value or an expressio…