What does the concurrency setting do?
⚡
Quick Answer
It groups runs so a new run cancels or queues behind superseded ones, preventing pile-ups.
Detailed Answer
concurrency with cancel-in-progress: true cancels an in-flight run when a newer commit arrives on the same ref — useful for fast feedback and to avoid deploying stale commits. Grouping by workflow + ref is the common pattern.
Code Example
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true💡
Interview Tip
Give the deploy use-case: cancel superseded deploys.
github-actionsconcurrency