In GitHub Actions when you push several commits it might happen that it doesn’t make any sense to finish the previous CI executions.

To improve resources usage there is an easy way to cancel previous jobs automatically by adding the following lines to your CI setup:

on:
  ...

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  ...