diff --git a/.github/scripts/check-releasenotes-labels.sh b/.github/scripts/check-releasenotes-labels.sh new file mode 100755 index 00000000000..d1f7ae8d489 --- /dev/null +++ b/.github/scripts/check-releasenotes-labels.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -o errexit +set -o pipefail +set -o nounset + +if [ "${HAS_ReleaseNotesNeeded}" == "true" ] ; then + if [ "${HAS_NoReleaseNotesNeeded}" == "true" ] ; then + >&2 echo "Conflicting release notes requirements" + exit 1 + fi + exit 0 +fi + +if [ "${HAS_NoReleaseNotesNeeded}" == "true" ] ; then + exit 0 +fi + +>&2 echo "No release notes requirements found" +exit 1 diff --git a/.github/workflows/label-check-ci.yml b/.github/workflows/label-check-ci.yml index a6defd6c6dd..4c4edf9e897 100644 --- a/.github/workflows/label-check-ci.yml +++ b/.github/workflows/label-check-ci.yml @@ -24,3 +24,15 @@ jobs: HAS_DocumentationNeeded: ${{ contains(github.event.pull_request.labels.*.name, 'DocumentationNeeded') }} HAS_NoDocumentationNeeded: ${{ contains(github.event.pull_request.labels.*.name, 'NoDocumentationNeeded') }} run: .github/scripts/check-doc-labels.sh + + releasenotes-labels: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Check Release Notes Labels + env: + HAS_ReleaseNotesNeeded: ${{ contains(github.event.pull_request.labels.*.name, 'ReleaseNotesNeeded') }} + HAS_NoReleaseNotesNeeded: ${{ contains(github.event.pull_request.labels.*.name, 'NoReleaseNotesNeeded') }} + run: .github/scripts/check-releasenotes-labels.sh