Your company forbids deploys on Friday after 16:00 and during incidents. How do you enforce it?
AdvancedScenarioPipeline Design & Triggers
Answer
Situation read → Policy that must not depend on YAML in every repo.
What I'd do →
- Use a custom deployment protection rule (a GitHub App) on the
prodenvironment that checks the change calendar and the incident tool API, then approves or rejects. - As a lighter option, a required first step in the shared reusable deploy workflow that checks the window and fails with a clear message, with a
forceinput that requires an extra environment (prod-emergency) with senior approvers. - Log every override to the summary and Slack.
Why → Environment-level rules apply to every workflow that targets prod and cannot be removed by editing one repo's YAML.
Interview tip → Always include a documented break-glass path; freezes without one get bypassed badly.
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