Maybe a bit late, but you could use Concurrency:
concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true