Skip to content

Commit

Permalink
Add a GitHub action to check for release notes labels. (#3124)
Browse files Browse the repository at this point in the history
* Add a GitHub action to check for release notes labels.

* Fixed execution bit
  • Loading branch information
chipkent authored Nov 30, 2022
1 parent dc086e1 commit fe4eeaa
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/scripts/check-releasenotes-labels.sh
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions .github/workflows/label-check-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fe4eeaa

Please sign in to comment.