From af5163efe0b55208bb328f453769a1ddfa6755b1 Mon Sep 17 00:00:00 2001 From: Glenn-Clarke <152421975+Glenn-Clarke@users.noreply.github.com> Date: Tue, 30 Apr 2024 16:08:45 +0100 Subject: [PATCH] PC-1045: add yml file to check for label when PR targeting main --- .github/workflows/main-label-check.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/main-label-check.yml diff --git a/.github/workflows/main-label-check.yml b/.github/workflows/main-label-check.yml new file mode 100644 index 00000000..3d3c02c5 --- /dev/null +++ b/.github/workflows/main-label-check.yml @@ -0,0 +1,17 @@ +name: main_label_check + +on: + pull_request: + types: [opened, edited, labeled, unlabeled] + +jobs: + label_check: + runs-on: ubuntu-latest + steps: + - name: Fail if no "production release" label is present while targeting main + if: ${{github.event.pull_request.base.ref == 'main' && !contains(github.event.pull_request.labels.*.name, 'production release')}} + uses: actions/github-script@v3 + with: + script: | + core.setFailed("Label is missing: add a 'production release' label in order to merge to main") +