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

A reusable workflow uses `concurrency: ${{ github.workflow }}` and two different callers cancel each other unexpectedly, or never serialize. Explain and fix.

AdvancedScenarioReuse at Scale: Reusable Workflows & Actions
Answer

Situation read → github.workflow resolves to the caller's name, so groups differ per caller (no serialization across callers) or collide if callers share names.

What I'd do →

  1. Define the group from explicit inputs: group: deploy-${{ inputs.environment }}-${{ inputs.service }}.
  2. Put it at job level in the reusable workflow with cancel-in-progress: false.

Why → Deterministic group keys based on what is being protected (environment and service) are the only safe choice.

Interview tip → "Concurrency keys should describe the resource, not the workflow."

All GitHub Actions questions Roadmap: GitHub Actions

More on Reuse at Scale: Reusable Workflows & Actions