Conditionally run jobs based on file changes.
Section: Avoid running everything on every change
GitLab rules with changes
yaml
yaml
web_test:
stage: test
rules:
- changes:
- apps/web/**/*
- packages/ui/**/*Explanation
`rules:changes` helps keep large repositories efficient and focused.
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
Generate jobs per package
Drive job fan-out from changed package lists or matrix inputs.
Wrap repeated commands in repo scripts
Keep YAML small by moving logic into versioned scripts.
Expose pipeline health publicly
Add workflow status badges to docs or README files.