From b35a064eaea827f67c9aab9283be50657d2e8875 Mon Sep 17 00:00:00 2001 From: ppigazzini Date: Sun, 26 Apr 2026 09:39:32 +0200 Subject: [PATCH] ci: cancel stale workflow runs per PR or ref Add workflow-level concurrency to the direct GitHub Actions entrypoints so a newer run for the same pull request or repository ref cancels the older in-progress run. Keep the reusable workflow graph, release guards, triggers, and permissions unchanged while documenting the concurrency policy and the official GitHub references used for the change. closes https://github.com/official-stockfish/Stockfish/pull/6773 No functional change. --- .github/workflows/clang-format.yml | 4 ++++ .github/workflows/codeql.yml | 4 ++++ .github/workflows/stockfish.yml | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 3d283aa8f..19f3235d1 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -12,6 +12,10 @@ on: - "**.cpp" - "**.h" +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + permissions: pull-requests: write diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 775a543bb..f23f19849 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -9,6 +9,10 @@ on: schedule: - cron: "17 18 * * 1" +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: analyze: name: Analyze diff --git a/.github/workflows/stockfish.yml b/.github/workflows/stockfish.yml index 3e69d9225..0d5bceebf 100644 --- a/.github/workflows/stockfish.yml +++ b/.github/workflows/stockfish.yml @@ -11,6 +11,11 @@ on: branches: - master - tools + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: Prerelease: if: github.repository == 'official-stockfish/Stockfish' && (github.ref == 'refs/heads/master' || (startsWith(github.ref_name, 'sf_') && github.ref_type == 'tag'))