GitHub Actions action.yml "A mapping was found where a scalar is expected"
An action.yml defines metadata with a strict schema. Writing a mapping where a scalar (like default or description) is expected, or mis-structuring runs.steps, makes the action metadata invalid.
What this error means
An action fails to load reporting an invalid metadata structure, often a mapping where a scalar was expected in inputs or runs.
github-actions
Error: .github/actions/build/action.yml: A mapping was found where a scalar value is expected for 'default'.Common causes
Scalar key given a mapping
Keys like description or default expect a single value, not a nested mapping.
Malformed runs.steps for composite
Composite steps must be a sequence of step mappings under runs.steps.
How to fix it
Match the action.yml schema
- Give scalar keys single values (strings/booleans).
- Write composite steps as a list under runs.steps.
- Validate action.yml against the metadata schema or with actionlint.
action.yml
inputs:
name:
description: 'Build target'
required: true
default: 'all'
runs:
using: composite
steps:
- shell: bash
run: ./build.sh ${{ inputs.name }}How to prevent it
- Validate action metadata in CI for any local/composite action.
- Keep scalar keys scalar and step lists as sequences.
Related guides
GitHub Actions composite action inputs not passedFix a GitHub Actions composite action whose inputs are empty - composite steps must reference inputs via the…
GitHub Actions container action requires uses with a Dockerfile/imageFix a GitHub Actions Docker container action that fails because runs.using is docker but no image or Dockerfi…
GitHub Actions "A mapping was found where a sequence is expected"Fix "A mapping was found where a sequence is expected" - a list-typed key like steps or jobs.<id>.needs was w…