Leadership wants a weekly report of failed workflow runs across 50 repos. How do you build it?
IntermediateScenarioPipeline Design & Triggers
Answer
Situation read → Cross-repo read access and aggregation.
What I'd do →
- Central repo with a
scheduleworkflow. - GitHub App token with
actions: readon the org's repos (actions/create-github-app-tokenwithowner: devopsshack). - Script with
gh api --paginate "repos/ORG/$r/actions/runs?status=failure&created=>=$(date -d '7 days ago' +%F)", aggregate by workflow and repo. - Write markdown to
$GITHUB_STEP_SUMMARYand post to Slack.
Why → GITHUB_TOKEN is single-repo; an App token is the right cross-repo identity.
Interview tip → For orgs at scale, mention streaming audit logs and Actions metrics instead of polling.
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