Reusable workflow vs composite action: give a decision you would make for three cases.
AdvancedConceptCustom Actions & Reusable Workflows
Answer
- "Every service must build, scan and push an image the same way, with OIDC and environment approval for prod": reusable workflow, because it needs jobs, permissions, environments and centrally controlled runners.
- "Twenty repos copy the same five setup steps (checkout, setup-node, cache, npm ci, lint config)": composite action, because it is steps inside the consumer's job.
- "Parse a coverage report and post a formatted PR comment with thresholds": JavaScript action, because it is logic and API calls, needs tests, and must run on any OS.
Interviewers want: reusable workflow equals job-level template with governance; composite equals step-level macro.
More on Custom Actions & Reusable Workflows
What are the three kinds of custom action and how do you choose?BeginnerWrite a minimal composite action that installs Node and dependencies with caching.IntermediateWhat can a composite action not do compared to a job?IntermediateHow do you pass outputs out of a composite action?IntermediateWhat does `action.yml` contain for a JavaScript action?IntermediateWhy must a JavaScript action commit its `dist/` or `node_modules`?Intermediate