diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75c8d97..96bcdda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,12 @@ env: DOTNET_CLI_TELEMETRY_OPTOUT: "1" DOTNET_NOLOGO: "1" +# A new push to a pull request cancels its older runs. A push to main waits +# for the run before it, and only the newest waiting run starts. +concurrency: + group: ci-${{ github.workflow }}-${{ (github.event_name == 'pull_request' || github.event_name == 'push') && github.ref || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: build: name: Build and pack the NuGet package diff --git a/.github/workflows/malware-scan.yml b/.github/workflows/malware-scan.yml index 1ae675b..235706e 100644 --- a/.github/workflows/malware-scan.yml +++ b/.github/workflows/malware-scan.yml @@ -30,6 +30,12 @@ on: permissions: contents: read +# A new push to a pull request cancels its older runs. A push to main waits +# for the run before it, and only the newest waiting run starts. +concurrency: + group: malware-scan-${{ github.workflow }}-${{ (github.event_name == 'pull_request' || github.event_name == 'push') && github.ref || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: # The package both engines scan: the caller's when Publish passes one, # otherwise built here exactly as CI and Publish build it. diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 05e4dd3..0179695 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -24,6 +24,12 @@ on: permissions: contents: read +# A new push to a pull request cancels its older runs. A push to main waits +# for the run before it, and only the newest waiting run starts. +concurrency: + group: security-${{ github.workflow }}-${{ (github.event_name == 'pull_request' || github.event_name == 'push') && github.ref || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: codeql: name: CodeQL (${{ matrix.language }})