liam.pm

Cancel previous jobs in GitHub actions

Prevent resource waste by automatically cancelling outdated workflow runs when new commits are pushed.

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

How it works

More specific grouping

For workflows that should only cancel within the same workflow:

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

Use cases

Source: https://hamel.dev/blog/posts/dokku/