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 →
- Define the group from explicit inputs:
group: deploy-${{ inputs.environment }}-${{ inputs.service }}. - 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."
More on Reuse at Scale: Reusable Workflows & Actions
Forty microservice repos each have a slightly different copy of the same build workflow. How do you standardize?IntermediateA team wants to share "checkout, setup Java, Maven cache, run Sonar" steps. Reusable workflow or composite action?BeginnerA shared reusable workflow change broke 120 pipelines on Monday. How do you prevent a repeat?IntermediateA called reusable workflow needs a Sonar token, an npm token and AWS access. How do you pass them?AdvancedYou want to ensure only the central deploy workflow can assume the production AWS role, not arbitrary workflows in app repos. How?AdvancedYou need an action that comments a Terraform plan summary on PRs and must work on Linux and Windows. Which kind?Beginner