Skip to content

Commit

Permalink
Adds a sanity check on release notes
Browse files Browse the repository at this point in the history
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
qu1queee committed May 6, 2021
1 parent 97e34d4 commit 00817de
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/release-notes-linter.yaml
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

0 comments on commit 00817de

Please sign in to comment.