GitHub rejects a workflow: every step must define a uses or run key
every step must define a `uses` or `run` keyShort answer
Each item in steps has to be either an action (uses) or a shell command (run). The error means one item has neither. The usual reason is a stray hyphen that splits one step in two, or a step that only has a name, if or env. Find that item and merge or complete it.
Fix it fast
1Find out which cause you have
The message gives no step name, so list every step item and look for one that has no uses or run line under it.
grep -n -E "^\s*- |^\s*(uses|run):" .github/workflows/*.yml2Match what you see, then jump to its fix
What does the error look like?
every step must define a `uses` or `run` key
Cause 1 of 2
A hyphen was placed in front of the second key of a step
1Check
A hyphen starts a new list item. If it sits before uses, the earlier name line becomes a step of its own, with no uses or run.
grep -n -B1 -E "^\s*- (uses|run):" .github/workflows/*.yml2Fix
Remove the extra hyphen so name and uses sit in one step, at the same indentation.
steps:
# wrong
- name: Checkout
- uses: actions/checkout@v4
# right
- name: Checkout
uses: actions/checkout@v43Verify
Commit the file. The workflow appears in the Actions tab without the error.
gh workflow listConfirmed by github.com
Cause 2 of 2
A step has only metadata
1Check
A step is either an action or a shell command. Keys such as name, if, env and with only describe the step; they do not make it one. with also only passes inputs to an action.
grep -n -A4 -E "^\s*- name:" .github/workflows/*.yml2Fix
Add the missing uses or run, or delete a placeholder step you do not need.
- name: Install dependencies
run: npm ci3Verify
The workflow loads and the step runs.
gh workflow listConfirmed by docs.github.com
How do I stop it coming back?
- Read the diff of the workflow file before you push: every new hyphen under steps starts a new step.
- Keep one step per list item, with all its keys under the same hyphen.
- Delete placeholder steps instead of leaving a name alone.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Related fixes
Servers
Docker push to Artifact Registry fails from GitHub Actions with a permission error
Permission 'artifactregistry.repositories.uploadArtifacts' denied on resource
The identity your workflow authenticates as lacks the permission artifactregistry.repositories.uploadArtifacts on the target repository.
4 causes, each with a fixServers
docker pull or push to ghcr.io fails with 'denied'
Error response from daemon: denied
ghcr.io refuses a pull or push when Docker is not logged in, when the token lacks the package scope, or when the workflow's GITHUB_TOKEN has no packages permission or no access to that package.
4 causes, each with a fixServers
git says it could not read Username for https://github.com in a build or CI job
fatal: could not read Username for 'https://github.com': No such device or address
Git asked for HTTPS credentials and there was no terminal to ask on, so it gave up.
3 causes, each with a fixServers
upload-artifact fails because the artifact storage quota is full
Create Artifact Container failed: Artifact storage quota has been hit. Unable to upload any new artifacts
Uploads fail when your account's shared artifact storage is used up.
3 causes, each with a fixServers
configure-aws-credentials says no OpenID Connect provider exists for GitHub
No OpenIDConnect provider found in your account for https://token.actions.githubusercontent.com
AWS has no IAM identity provider for GitHub's token issuer in the account that holds the role.
3 causes, each with a fixServers
A local composite action in GitHub Actions cannot be found
The action folder is in the repository but the runner reports that its action.yml cannot be found
A local action is read from the checked-out repository.
3 causes, each with a fix