diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index d8c03800..43284c6d 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -17,9 +17,10 @@ on: - cron: "0 6 * * 1" # weekly, Monday 06:00 UTC workflow_dispatch: +# Cancel superseded runs only for pull requests; runs on main are never cancelled. concurrency: - group: benchmark-${{ github.ref }} - cancel-in-progress: true + group: benchmark-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: contents: read diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22e86898..dcf8d177 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,9 +8,12 @@ on: - cron: "0 3 * * *" workflow_dispatch: +# Only a newer push to the same PR cancels an in-progress run. On main, each +# merge, the nightly schedule and manual dispatches get their own group and are +# never cancelled, so every merged commit keeps a complete result. concurrency: - group: ci-${{ github.ref }} - cancel-in-progress: true + group: ci-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} # Least privilege by default; jobs that need more (nightly alert issue, # coverage-badge push) declare their own elevated permissions. diff --git a/.github/workflows/perf-regression.yml b/.github/workflows/perf-regression.yml index dcc7b811..9789d3d5 100644 --- a/.github/workflows/perf-regression.yml +++ b/.github/workflows/perf-regression.yml @@ -29,9 +29,11 @@ on: type: boolean default: false +# Cancel superseded runs only for pull requests; scheduled and manual runs on +# main never cancel each other. concurrency: - group: perf-regression-${{ github.ref }} - cancel-in-progress: true + group: perf-regression-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: contents: read