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.
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