Skip to content
Latchkey

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' value

Common 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

  1. Convert lists to a delimited or multi-line string.
  2. Quote values to force string type when needed.
.github/workflows/ci.yml
with:
  args: "--flag-a --flag-b"
env:
  PATHS: |
    src
    test

How to prevent it

  • Check each action README for the expected input format.
  • Run actionlint to catch type mismatches.

Related guides

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