From 7519981f51920d6115b7362c2ca4057ae9a8bf41 Mon Sep 17 00:00:00 2001 From: Matt Bishop Date: Mon, 18 Mar 2024 10:55:32 -0400 Subject: [PATCH] Enforce labels workflow (#260) --- .github/workflows/enforce-labels.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/enforce-labels.yml diff --git a/.github/workflows/enforce-labels.yml b/.github/workflows/enforce-labels.yml new file mode 100644 index 00000000..65f63666 --- /dev/null +++ b/.github/workflows/enforce-labels.yml @@ -0,0 +1,19 @@ +--- +name: Enforce PR labels + +on: + workflow_call: + pull_request: + types: [labeled, unlabeled, opened, reopened, synchronize] +jobs: + enforce-label: + if: ${{ contains(github.event.*.labels.*.name, 'hold') || contains(github.event.*.labels.*.name, 'needs-qa') }} + name: Enforce label + runs-on: ubuntu-22.04 + + steps: + - name: Check for label + run: | + echo "PRs with the hold or needs-qa labels cannot be merged" + echo "### :x: PRs with the hold or needs-qa labels cannot be merged" >> $GITHUB_STEP_SUMMARY + exit 1