GitHub Actions step cannot have both uses and run, and what you get
A GitHub Actions step cannot have both uses and run, and that sentence was once the message you got, but the parser that ships today does not contain it anywhere. What it produces instead names one of the two keys as unexpected, which is a different sentence and a more precise one once you know how the reader arrives at it. The reader narrows as it reads. The first of the two keys chooses a…
A GitHub Actions step cannot contain both `uses` and `run` keys at the same time. If you try to include both, you will encounter an error that tells you which key is unexpected. The error message narrows down as you read it, starting with which key is chosen and which one has nowhere to go.
The error message also includes the line number, column number, and the name of the unexpected key. This information helps you identify the exact location of the issue in your workflow file. The key that appears first in your file will win, and the second key will be rejected because there are no loose keys to absorb it.
To fix the error, you need to split your step into two separate steps, each with its own `uses` or `run` key. If you intended to run an action followed by a command, create two distinct steps instead of trying to combine them into one. This will ensure that the workflow runs successfully and produces valid annotations in your commit.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.