Skip to content
Latchkey

GitHub Actions "every step must define a 'uses' or 'run' key"

A step in your steps: list has metadata (name, if, env) but no uses: action or run: command, so there is nothing for it to do and the workflow is rejected.

What this error means

The workflow is invalid with ".github#L1 every step must define a uses or run key", pointing at a step that has no action and no command.

Actions annotation
Invalid workflow file: .github/workflows/ci.yml
.github#L12 every step must define a 'uses' or 'run' key

Common causes

Step has only metadata

A step that lists name:, if:, or env: but neither uses: nor run: has no executable body, which is invalid.

Indentation orphaned the run/uses

A run: or uses: indented one level too deep becomes a child of the wrong key, so the step it was meant for ends up empty.

How to fix it

Give every step a uses or run

Each list item under steps: must call an action with uses: or execute a command with run:.

.github/workflows/ci.yml
steps:
  - name: Build
    run: make            # run a command
  - uses: actions/checkout@v4   # or call an action

Check the step indentation

  1. Confirm run: / uses: align with name: inside the same list item (a leading - per step).
  2. Remove placeholder steps that only carry a comment or name.
  3. Validate with actionlint, which flags steps missing uses/run.

How to prevent it

  • Ensure every step has exactly one of uses: or run:.
  • Keep step keys aligned under the same list item.
  • Lint workflows with actionlint to catch empty steps.

Related guides

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