diff --git a/.github/workflows/check-pr-label.yml b/.github/workflows/check-pr-label.yml new file mode 100644 index 000000000..a4e4f57f6 --- /dev/null +++ b/.github/workflows/check-pr-label.yml @@ -0,0 +1,21 @@ +name: Require label for category before merge + + +on: + pull_request: + types: [opened, reopened, edited, labeled, unlabeled, synchronize] + +jobs: + check-for-label: + runs-on: ubuntu-latest + steps: + - name: Labels not added + if: > + contains(github.event.pull_request.labels.*.name, 'Breaking-Changes') == false && + contains(github.event.pull_request.labels.*.name, 'Bug-Fixes') == false && + contains(github.event.pull_request.labels.*.name, 'Documentation') == false && + contains(github.event.pull_request.labels.*.name, 'Feature') == false && + contains(github.event.pull_request.labels.*.name, 'Chore') == false + run: | + echo "This PR can't be merged, because it does not have a release category label. See release_notes.md" + exit 1