From edcdf7fb99f59dc5f1ff2c0f814c80d15e5dfa08 Mon Sep 17 00:00:00 2001 From: luisleo526 Date: Mon, 19 Oct 2026 18:40:19 +0800 Subject: [PATCH] ci: cancel only superseded pull-request runs of the gate and test workflows gate.yml grouped by pull request number or ref with cancel-in-progress true for every event, so a newer scheduled, dispatched or main run cancelled an older one; test.yml grouped by commit sha with cancel-in-progress true. Both now use one group per pull request (gate.yml: pull_request_target) and the run id for every other event, and cancel only for the pull-request event. The docs-only preflight, the differential and pytest jobs, the gate status job, permissions, runners and every pin are unchanged. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/gate.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gate.yml b/.github/workflows/gate.yml index 8d4962dd..27717f7e 100644 --- a/.github/workflows/gate.yml +++ b/.github/workflows/gate.yml @@ -10,8 +10,8 @@ on: permissions: {} concurrency: - group: gate-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true + group: gate-${{ github.event_name == 'pull_request_target' && format('pr-{0}', github.event.pull_request.number) || format('run-{0}', github.run_id) }} + cancel-in-progress: ${{ github.event_name == 'pull_request_target' }} jobs: preflight-docs: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1cc066d4..e2051005 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,8 +9,8 @@ permissions: contents: read concurrency: - group: test-${{ github.sha }} - cancel-in-progress: true + group: test-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('run-{0}', github.run_id) }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: preflight-docs: