GitHub Actions "Unexpected value 'steps'" in CI
The workflow validator allows steps only inside a job. When steps appears one level too high (under the workflow root, or directly under jobs), it reports "Unexpected value 'steps'".
What this error means
The run fails with "Invalid workflow file" and "(Line: N, Col: M): Unexpected value 'steps'", with the line pointing at a steps: key outside a job body.
GitHub Actions
Invalid workflow file: .github/workflows/ci.yml
(Line: 6, Col: 1): Unexpected value 'steps'Common causes
steps defined under jobs instead of under a job
A job id was forgotten, so steps: sits directly under jobs: rather than inside jobs.<id>:.
Indentation collapsed a job
A de-indented steps: escaped its job mapping and landed at a level the schema does not accept.
How to fix it
Nest steps inside a named job
- Add a job id under
jobs:. - Put
runs-onandstepsinside that job. - Re-run the workflow.
.github/workflows/ci.yml
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4Check the indentation of the job body
Ensure runs-on and steps are indented one level deeper than the job id.
How to prevent it
- Always declare a job id between
jobs:andsteps:. - Use a schema-aware editor that flags misplaced keys.
- Keep job bodies consistently indented.
Related guides
GitHub Actions "Unexpected value 'runs-on'" in CIFix GitHub Actions "Unexpected value 'runs-on'" in CI - `runs-on` was placed outside a job, where the workflo…
GitHub Actions "Required property is missing: jobs" in CIFix GitHub Actions "Required property is missing: jobs" in CI - the workflow has no top-level `jobs` mapping,…
GitHub Actions "mapping values are not allowed in this context" in CIFix GitHub Actions "while scanning ... mapping values are not allowed in this context" in CI - a stray colon…