You need to run a job only when files in `infra/` changed, but the workflow also has other jobs that always run. How?
IntermediateScenarioPipeline Design & Triggers
Answer
Situation read → Workflow-level paths would skip everything; need job-level filtering.
What I'd do →
- A
changesjob usingdorny/paths-filterwith outputsinfra: 'true'|'false'. terraformjob:needs: changes,if: needs.changes.outputs.infra == 'true'.- Fan-in job treats
skippedas success.
Why → Skipped jobs report as success to branch protection, skipped workflows report nothing.
Interview tip → This is the canonical answer to "path filters vs required checks".
More on Pipeline Design & Triggers
You join a team whose single 900-line workflow runs everything on every push to every branch. How do you restructure it?IntermediatePushing to a PR branch runs CI twice (once for push, once for pull_request). How do you fix it?BeginnerProduct wants a "Deploy to staging" button that lets QA pick a version. Design it.BeginnerA nightly security scan should run at 02:00 India time on weekdays and also be runnable on demand. Write it.BeginnerYour team wants preview environments per PR on EKS, destroyed when the PR closes. Design the workflow.AdvancedTwo workflows must run in sequence: CI then a separate deploy workflow owned by another team. How do you link them?Intermediate