Interview Prep/CI/CD/GitHub Actions

What is the difference between a reusable workflow and a composite action?

AdvancedConceptGitHub Actions
Answer

A reusable workflow is a whole workflow that contains its own jobs and runners, called at job level (jobs.x.uses). It can use secrets, environments and multiple jobs, but nesting is limited (a few levels deep, with a cap on total calls per workflow) and it shows as separate jobs in the UI.

A composite action (action.yml with runs.using: composite) bundles multiple steps into one step that runs inside the caller's job, on the caller's runner and filesystem. It cannot define jobs or use secrets directly (pass them as inputs), and every run step needs an explicit shell:.

Use composite actions for step-level reuse (setup + cache + install) and reusable workflows for standardising entire pipelines.

All CI/CD questions

More on GitHub Actions