Section: Jobs, steps, and conditionals

Run a job only for tags

yaml
yaml
jobs:
  release:
    if: startsWith(github.ref, 'refs/tags/')
    runs-on: ubuntu-latest
Explanation

Use job-level conditions when the whole job should be skipped.

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
Run a step only on main
Use expressions with `if` to gate steps.
OpenIn sheetyamlsame section
Check out repository code
Fetch the repo in a workflow job.
OpenIn sheetyamlsame section
Set up Node.js
Install a specific Node.js version for the job.
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.
Run on multiple operating systems
Validate portability across Linux, macOS, and Windows.