Interview Prep/GitHub Actions/Custom Actions & Reusable Workflows

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.

All GitHub Actions questions Roadmap: GitHub Actions

More on Custom Actions & Reusable Workflows