Interview Prep/GitHub Actions/Reuse at Scale: Reusable Workflows & Actions

A team wants to share "checkout, setup Java, Maven cache, run Sonar" steps. Reusable workflow or composite action?

BeginnerScenarioReuse at Scale: Reusable Workflows & Actions
Answer

Situation read → A sequence of steps that should run inside the consumer's job.

What I'd do →

  1. Composite action in platform-actions/java-setup/action.yml, inputs java-version and sonar-token.
  2. Consumers add it as one step and keep their own job settings and runner choice.

Why → No need for separate runners, environments or permissions; a composite is lighter and composes with the consumer's other steps.

Interview tip → Note the composite cannot read secrets directly, so the Sonar token is an input.

All GitHub Actions questions Roadmap: GitHub Actions

More on Reuse at Scale: Reusable Workflows & Actions