From 7617a44a57915864c096cbcedadb03636d2d643f Mon Sep 17 00:00:00 2001 From: Ariella Vu <20778143+digiwand@users.noreply.github.com> Date: Fri, 21 Apr 2023 12:31:49 -0300 Subject: [PATCH] Add "Do Not Merge" GH Action to block PRs with "DO-NOT-MERGE" label (#18724) * gh action: do-not-merge * gh action: do-not-merge update * gh action: Do Not Merge - use github.event.pull_request Co-authored-by: Mark Stacey --------- Co-authored-by: Mark Stacey --- .github/workflows/do-not-merge.yml | 17 +++++++++++++++++ 1 file changed, 17 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..1315a282b --- /dev/null +++ b/.github/workflows/do-not-merge.yml @@ -0,0 +1,17 @@ +# Fails the pull request if it has the "DO-NOT-MERGE" label + +name: Check "DO-NOT-MERGE" label + +on: + pull_request: + types: [opened, reopened, labeled, unlabeled, synchronize] + +jobs: + do-not-merge: + runs-on: ubuntu-latest + if: ${{ contains(github.event.pull_request.labels.*.name, 'DO-NOT-MERGE') }} + steps: + - name: 'Check for label "DO-NOT-MERGE"' + run: | + echo 'This check fails PRs with the "DO-NOT-MERGE" label to block merging' + exit 1