What is the purpose of workflow concurrency control in GitHub Actions?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Concurrency control is how you prevent duplicate deployments. Set a concurrency group and GitHub ensures only one workflow in that group runs at a time — newer runs cancel older ones, so you're never deploying stale code.
Full explanation below image
Full Explanation
GitHub Actions workflow concurrency settings prevent multiple workflow runs from executing simultaneously when they share the same concurrency group key. When configured, if a new workflow run is triggered while one with the same concurrency group is already running, the behavior depends on 'cancel-in-progress': if true, the in-progress run is cancelled in favor of the new run; if false, the new run is queued and waits. Common use case: preventing concurrent deployments to the same environment, where only the latest deployment should proceed. Concurrency groups can use expressions like '${{ github.ref }}' to create per-branch concurrency control. This does not limit runner job counts, secret access, or job execution order (use 'needs' for that).