-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a sanity check on release notes
Validate if the PR contains a release note in the form of: - NONE - free text - action required: free text if not then fail the check.
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
name: Release Note Linter | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
name: Release Note Linter | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install wget | ||
run: sudo apt-get install wget | ||
- name: Install jq | ||
run: sudo apt-get install jq | ||
- name: Sanity Check Release Notes | ||
env: | ||
PR_NUMBER: ${{ github.event.number }} | ||
run: | | ||
# Validate PR release notes | ||
echo "Going to validate PR ${PR_NUMBER}" | ||
MATCHES=$(wget -q -O- https://api.github.com/repos/shipwright-io/build/pulls/${PR_NUMBER} | jq '.body | match("(```release-note\r\n(.*|NONE|action required: .*)\r\n```)")') | ||
if [ -z "${MATCHES}" ]; then | ||
echo "Your Release Notes were not properly defined or they are not in place, please make sure you add them." | ||
echo "See our PR template for more information: https://raw.githubusercontent.com/shipwright-io/build/master/.github/pull_request_template.md" | ||
exit 1 | ||
else | ||
echo "Your Release Notes are properly in place!" | ||
fi |