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' 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.
.github/workflows/ci.yml
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.
Related guides
GitHub Actions "mapping values are not allowed in this context"Fix the GitHub Actions YAML error "mapping values are not allowed in this context" caused by a stray colon or…
GitHub Actions YAML "did not find expected key"Fix the GitHub Actions YAML error "did not find expected key" caused by broken indentation that leaves the pa…
GitHub Actions "Invalid workflow file: error in your yaml syntax"Fix the GitHub Actions "Invalid workflow file: You have an error in your yaml syntax" message caused by tabs,…