You want to run expensive E2E tests only when a PR has the `run-e2e` label, and re-run when the label is added. How?
IntermediateScenarioPipeline Design & Triggers
Answer
Situation read → Needs the labeled activity type plus a condition.
What I'd do →
- Trigger on the label event and filter on the label name:
on: pull_request: types: [opened, synchronize, reopened, labeled] jobs: e2e: if: contains(github.event.pull_request.labels.*.name, 'run-e2e') - Use a concurrency group per PR so adding another label does not run E2E twice in parallel.
- Make E2E non-required, or required through the fan-in job that treats
skippedas pass.
Why → Labels are a cheap opt-in for expensive suites.
Interview tip → Note that labeled fires for any label, hence the contains filter.
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