Your organization has 30 repos that all need the same build-and-push-image pipeline.
IntermediateScenarioGitHub Actions
Answer
Situation read → Duplicated workflows.
What I'd do →
- Create a central repo with a reusable workflow using
on: workflow_calland typedinputs/secrets. - Call it:
uses: my-org/ci-workflows/.github/workflows/build.yml@v2withwith:andsecrets: inherit(or explicit secrets). - Version it by tag and update through Dependabot.
Why → Central maintenance with versioning, and callers keep a 10-line file.
Interview tip → Contrast reusable workflows (whole jobs) with composite actions (steps).
More on GitHub Actions
What are workflows, jobs, steps and actions in GitHub Actions?BeginnerWhat events can trigger a workflow?BeginnerWhat is the difference between `pull_request` and `pull_request_target`?AdvancedWhat is a runner, and how do GitHub-hosted and self-hosted runners differ?BeginnerHow do you pass data between steps and between jobs?IntermediateHow does a build matrix work?Intermediate