Section: Jobs, steps, and conditionals

Set up Node.js

yaml
yaml
- uses: actions/setup-node@v4
  with:
    node-version: 20
Explanation

Use official setup actions for language runtimes whenever possible.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Jobs, steps, and conditionals
Check out repository code
Fetch the repo in a workflow job.
OpenIn sheetyamlsame section
Run a step only on main
Use expressions with `if` to gate steps.
OpenIn sheetyamlsame section
Run a job only for tags
Gate a full job on a tag-based release.
OpenIn sheetyamlsame section
Allow a non-blocking step
Continue the job even if a step fails.
OpenIn sheetyamlsame section
Test across multiple Node versions
Use a strategy matrix for version coverage.
OpenIn sheetyaml1 tag match
Run on multiple operating systems
Validate portability across Linux, macOS, and Windows.