From 2f54994011e4f1ecb3f1b8369ccbed2a972c3132 Mon Sep 17 00:00:00 2001 From: Zhongxuan Wang Date: Thu, 30 Jul 2026 13:48:35 -0700 Subject: [PATCH 1/3] ci: block merging labeled pull requests Signed-off-by: Zhongxuan Wang --- .github/workflows/do-not-merge.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/do-not-merge.yml diff --git a/.github/workflows/do-not-merge.yml b/.github/workflows/do-not-merge.yml new file mode 100644 index 000000000..3f66e1421 --- /dev/null +++ b/.github/workflows/do-not-merge.yml @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +name: Do Not Merge + +on: + pull_request: + types: [labeled, unlabeled, opened, reopened, synchronize] + +jobs: + label-check: + name: DO NOT MERGE label + runs-on: ubuntu-24.04 + timeout-minutes: 1 + permissions: {} + steps: + - name: Check label + env: + BLOCK_MERGE: ${{ contains(github.event.pull_request.labels.*.name, 'DO NOT MERGE') }} + run: | + if [[ "$BLOCK_MERGE" == "true" ]]; then + echo "::error::Remove the DO NOT MERGE label before merging." + exit 1 + fi From ef79efad058fb0fc2c03447bf716b5ce67599b75 Mon Sep 17 00:00:00 2001 From: Zhongxuan Wang Date: Thu, 30 Jul 2026 13:55:16 -0700 Subject: [PATCH 2/3] ci: skip label gate when merge is allowed Signed-off-by: Zhongxuan Wang --- .github/workflows/do-not-merge.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/do-not-merge.yml b/.github/workflows/do-not-merge.yml index 3f66e1421..5a88445ac 100644 --- a/.github/workflows/do-not-merge.yml +++ b/.github/workflows/do-not-merge.yml @@ -10,15 +10,12 @@ on: jobs: label-check: name: DO NOT MERGE label + if: contains(github.event.pull_request.labels.*.name, 'DO NOT MERGE') runs-on: ubuntu-24.04 timeout-minutes: 1 permissions: {} steps: - - name: Check label - env: - BLOCK_MERGE: ${{ contains(github.event.pull_request.labels.*.name, 'DO NOT MERGE') }} + - name: Block merge run: | - if [[ "$BLOCK_MERGE" == "true" ]]; then - echo "::error::Remove the DO NOT MERGE label before merging." - exit 1 - fi + echo "::error::Remove the DO NOT MERGE label before merging." + exit 1 From 32c241a20bffcc581fe8d16581679bf5f157b0e0 Mon Sep 17 00:00:00 2001 From: Zhongxuan Wang Date: Thu, 30 Jul 2026 14:10:02 -0700 Subject: [PATCH 3/3] ci: cancel stale label gate runs Signed-off-by: Zhongxuan Wang --- .github/workflows/do-not-merge.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/do-not-merge.yml b/.github/workflows/do-not-merge.yml index 5a88445ac..f7d24bf82 100644 --- a/.github/workflows/do-not-merge.yml +++ b/.github/workflows/do-not-merge.yml @@ -7,6 +7,10 @@ on: pull_request: types: [labeled, unlabeled, opened, reopened, synchronize] +concurrency: + group: do-not-merge-${{ github.event.pull_request.number }} + cancel-in-progress: true + jobs: label-check: name: DO NOT MERGE label