concurrency group

A workflow setting that lets only one run with the same group name proceed at a time, optionally cancelling the older run.

In more detail

Two quick pushes can start two deploys that race, and the older one may finish last and undo the newer one. A group built from github.ref with cancel-in-progress: true makes the newest push win and keeps different branches from queueing behind each other.

Example

concurrency:
  group: deploy-${{ github.ref }}
  cancel-in-progress: true

Related terms

Taught in

References

Certification courses