You want a team-specific step sequence (setup toolchain, cache, login) reused inside many jobs.
IntermediateScenarioGitHub Actions
Answer
Situation read → A repeated step sequence, not whole jobs.
What I'd do →
- Create a composite action:
action.ymlwithruns: using: compositeand steps; eachrunstep needs ashell:. - Place it in
.github/actions/setup/for one repo or in its own repo for sharing. - Call it with
uses: ./.github/actions/setup.
Why → Composite actions reduce boilerplate while staying transparent and easy to test.
Interview tip → Composite steps cannot use secrets context directly; pass them as inputs.
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