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.
Invalid workflow file: .github/workflows/ci.yml#L11
every step must define a 'uses' or 'run' keyCommon 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
- Add run: <command> for a shell step, or uses: owner/action@ref for an action step.
- Never put both uses and run on the same step.
- Confirm each list item under steps starts with a dash and its own keys.
steps:
- uses: actions/checkout@v4
- name: Test
run: npm testHow 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.