Skip to content
Latchkey

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

  1. Give scalar keys single values (strings/booleans).
  2. Write composite steps as a list under runs.steps.
  3. 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

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