Run workflows only when selected folders change.

Section: Avoid running everything on every change

GitHub path filters

yaml
yaml
on:
  push:
    paths:
      - 'apps/web/**'
      - 'packages/ui/**'
      - '.github/workflows/web.yml' 
Explanation

Path filters are one of the easiest ways to cut CI minutes in monorepos.

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 Avoid running everything on every change
GitLab rules with changes
Conditionally run jobs based on file changes.
OpenIn sheetyamlsame section
Generate jobs per package
Drive job fan-out from changed package lists or matrix inputs.
OpenIn sheetyamlsame section
Wrap repeated commands in repo scripts
Keep YAML small by moving logic into versioned scripts.
Use predictable workflow names
Name workflows by concern or application area.
Expose pipeline health publicly
Add workflow status badges to docs or README files.
OpenIn sheetmarkdown