Forty microservice repos each have a slightly different copy of the same build workflow. How do you standardize?
IntermediateScenarioReuse at Scale: Reusable Workflows & Actions
Answer
Situation read → Copy-paste drift; fixes do not propagate.
What I'd do →
- Create
devopsshack/platform-workflowswith reusable workflows:build-image.yml,deploy-eks.yml,security-scan.yml, each with typed inputs and outputs. - Set the repo's Actions access to "Accessible from repositories in the organization".
- Release with semver tags and a moving
v1; consumers pin@v1(or SHA with Renovate). - Migrate repos with a scripted PR (gh CLI loop), starting with two pilot teams.
- Enforce a minimum baseline (scan workflow) through a ruleset "require workflows to pass".
Why → One fix lands everywhere with a version bump, and governance moves to the platform team.
Interview tip → Mention versioning and a migration plan; a central workflow without versions breaks everyone at once.
More on Reuse at Scale: Reusable Workflows & Actions
A team wants to share "checkout, setup Java, Maven cache, run Sonar" steps. Reusable workflow or composite action?BeginnerA shared reusable workflow change broke 120 pipelines on Monday. How do you prevent a repeat?IntermediateA called reusable workflow needs a Sonar token, an npm token and AWS access. How do you pass them?AdvancedYou want to ensure only the central deploy workflow can assume the production AWS role, not arbitrary workflows in app repos. How?AdvancedYou need an action that comments a Terraform plan summary on PRs and must work on Linux and Windows. Which kind?BeginnerA reusable workflow needs to return the deployed URL to the caller. How?Beginner