From c2bc13af03aaabeb4135864cbcd3bfe28f3931f2 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Fri, 16 Aug 2024 11:05:29 +0800 Subject: [PATCH] Create do-not-merge-pr.yml --- .github/workflows/do-not-merge-pr.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/do-not-merge-pr.yml diff --git a/.github/workflows/do-not-merge-pr.yml b/.github/workflows/do-not-merge-pr.yml new file mode 100644 index 0000000000..9feb1bf6b8 --- /dev/null +++ b/.github/workflows/do-not-merge-pr.yml @@ -0,0 +1,19 @@ +name: Check for "option.do-not-merge" Label + +on: + pull_request: + types: [labeled, unlabeled, synchronize, opened, reopened] + +jobs: + check_label: + runs-on: ubuntu-latest + steps: + - name: Check for "option.do-not-merge" label + id: check_label + uses: actions/github-script@v6 + with: + script: | + const labels = context.payload.pull_request.labels.map(label => label.name); + if (labels.includes("option.do-not-merge")) { + core.setFailed('The "option.do-not-merge" label is present. PR cannot be merged.'); + }