Interview Prep/CI/CD/GitHub Actions

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 →

  1. Create a composite action: action.yml with runs: using: composite and steps; each run step needs a shell:.
  2. Place it in .github/actions/setup/ for one repo or in its own repo for sharing.
  3. 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.

All CI/CD questions

More on GitHub Actions