ci: cancel PR workflows on close (#4323)

This commit is contained in:
Zhengchao An
2026-07-06 22:38:00 +08:00
committed by GitHub
parent 83edafb11f
commit 5f1759eb3c
6 changed files with 79 additions and 8 deletions
+14 -2
View File
@@ -16,7 +16,7 @@ name: CLA Check
on:
pull_request_target:
types: [opened, synchronize, reopened]
types: [opened, synchronize, reopened, closed]
merge_group:
types: [checks_requested]
issue_comment:
@@ -28,9 +28,21 @@ permissions:
issues: write
checks: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.issue.number || github.ref }}
cancel-in-progress: true
jobs:
cancel-closed-pr-runs:
name: Cancel Closed PR Runs
if: github.event_name == 'pull_request_target' && github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: Explain cancellation run
run: echo "PR closed; this run only cancels older runs in the same concurrency group."
cla:
if: ${{ github.event_name != 'issue_comment' || github.event.issue.pull_request }}
if: ${{ (github.event_name != 'issue_comment' || github.event.issue.pull_request) && (github.event_name != 'pull_request_target' || github.event.action != 'closed') }}
runs-on: ubuntu-latest
steps:
- name: Report CLA result for merge queue