What Is a Step in GitHub Actions?
A step is the smallest executable unit in GitHub Actions. Each one either runs a command or calls an action.
Jobs are lists of steps. Steps execute in order on the same runner, and each can run a shell command or invoke a packaged action. They are how you actually get work done.
What it is
A step is an item in a job's steps: list. The two kinds are run: (a shell command) and uses: (a reference to an action).
steps:
- uses: actions/checkout@v4
- name: Install and test
run: |
npm ci
npm testHow it works
Steps run sequentially. Because they share the runner's filesystem, earlier steps set up state (clone the repo, install dependencies) that later steps rely on.
Naming and conditions
Give steps a name: for readable logs. You can run a step conditionally with if:, and reference its results elsewhere if it produces outputs.
Why it matters
Steps are where the actual build, test, and deploy commands live. Keeping them small and well-named makes failures easy to locate in the log.
Related concepts
Steps live inside jobs, can call actions via uses:, and can produce step outputs consumed by later steps.
Key takeaways
- A step is one task: a
run:command or auses:action. - Steps run in order and share the runner filesystem.
- Name steps for readable logs and gate them with
if:.