Skip to content
Latchkey

GitHub Actions "Unexpected value" at a specific workflow line

The YAML parsed but does not match the workflow schema. Actions found a value where it expected a known key or mapping.

What this error means

A validation annotation reads "The workflow is not valid. .github/workflows/x.yml (Line: N): Unexpected value <name>". The file is valid YAML but invalid as a workflow.

github-actions
The workflow is not valid. .github/workflows/ci.yml (Line: 9): Unexpected value 'step'

Common causes

Misspelled schema key

Keys like steps, runs-on, and needs are exact. A typo such as step or run-on is not recognized.

A key at the wrong nesting level

Placing a step-level key under a job, or a job-level key under steps, produces an unexpected value.

How to fix it

Match keys to the workflow schema

  1. Compare each key against the documented workflow syntax.
  2. Fix spelling and nesting depth at the named line.
  3. Run actionlint to get the intended key suggestion.
Terminal
actionlint .github/workflows/ci.yml

How to prevent it

  • Copy structure from a known-good workflow rather than from memory.
  • Enable the Actions schema in your editor.

Frequently asked questions

What causes ""Unexpected value""?
Keys like steps, runs-on, and needs are exact. A typo such as step or run-on is not recognized.
How do I fix "Unexpected value"?
Match keys to the workflow schema

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card