A nightly security scan should run at 02:00 India time on weekdays and also be runnable on demand. Write it.
BeginnerScenarioPipeline Design & Triggers
Answer
Situation read → Cron is UTC; IST is UTC+5:30.
What I'd do →
- Convert: 02:00 IST is 20:30 UTC the previous day, so weekdays Monday to Friday IST map to Sunday to Thursday UTC:
on: schedule: - cron: "30 20 * * 0-4" workflow_dispatch: - Guard against forks:
if: github.repository == 'devopsshack/shack-api'. - Notify on failure only (
if: failure()).
Why → The day-of-week shift is the classic mistake when converting to UTC.
Interview tip → Mention that schedules are best-effort and can be delayed at peak load, so do not use them for time-critical jobs.
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.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?IntermediateA merge queue is enabled, but PRs sit in the queue forever. What is your design fix?Intermediate