Skip to content
Latchkey

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

A step in your workflow has no action and no command, so Actions cannot decide what to execute. Every step needs exactly one of uses: or run:.

What this error means

The workflow is rejected before any job runs, with a validation annotation pointing at the offending step. The file is valid YAML but invalid as a workflow.

github-actions
Invalid workflow file: .github/workflows/ci.yml#L11
every step must define a 'uses' or 'run' key

Common causes

A step with only name or with

Writing a step that has name: and with: but no uses: or run: leaves nothing to execute. with: only supplies inputs to a uses: action.

Indentation collapsed two steps into one

If a run: line is under-indented it attaches to the previous step instead of forming a new list item, leaving the new dash entry empty.

How to fix it

Give every step a uses or a run

  1. Add run: <command> for a shell step, or uses: owner/action@ref for an action step.
  2. Never put both uses and run on the same step.
  3. Confirm each list item under steps starts with a dash and its own keys.
.github/workflows/ci.yml
steps:
  - uses: actions/checkout@v4
  - name: Test
    run: npm test

How to prevent it

  • Run actionlint locally or in CI to catch empty steps before merge.
  • Use an editor with the Actions YAML schema so empty steps are flagged.

Frequently asked questions

What causes ""every step must define a uses or run key""?
Writing a step that has name: and with: but no uses: or run: leaves nothing to execute. with: only supplies inputs to a uses: action.
How do I fix "every step must define a uses or run key"?
Give every step a uses or a run

Related guides

References

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