diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3ab09abefa1..602202fa3b2 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,6 +13,14 @@ on: # Check every Saturday at 18:36 - cron: "36 18 * * 6" +# Cancel previous workflow runs for pull requests. +# The concurrency group is workflow name and the branch name for pull requests, +# but it is the commit hash for any other events, so the group is unique and no +# runs are canceled. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + jobs: analyze: name: ${{ matrix.language }} diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index ca70041f896..d26340e63d5 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -4,6 +4,14 @@ on: - push - pull_request +# Cancel previous workflow runs for pull requests. +# The concurrency group is workflow name and the branch name for pull requests, +# but it is the commit hash for any other events, so the group is unique and no +# runs are canceled. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + jobs: build: name: ${{ matrix.os }} build and tests diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 9f5b8dae44e..95dc0c88a6f 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -5,6 +5,14 @@ on: - push - pull_request +# Cancel previous workflow runs for pull requests. +# The concurrency group is workflow name and the branch name for pull requests, +# but it is the commit hash for any other events, so the group is unique and no +# runs are canceled. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + jobs: build-and-test: name: ${{ matrix.os }} tests