Skip to content

Commit

Permalink
Merge pull request #70 from gabemontero/rel-note-linter
Browse files Browse the repository at this point in the history
add release note linter
  • Loading branch information
openshift-merge-robot authored Oct 31, 2021
2 parents aa2bbfd + af8e5d3 commit 9a759d6
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/release-notes-linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Release Note Linter

on:
pull_request:
branches:
- main

jobs:
verify:
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}"
echo "First making sure you have not left the PR template as is"
# Describe any user facing changes here, or delete this block.
TEMPLATE_LEFT_AS_IS=$(wget -q -O- https://api.github.com/repos/shipwright-io/cli/pulls/${PR_NUMBER} | jq '.body | match("(Describe any user facing changes here, or delete this block)")')
if [ -z "${TEMPLATE_LEFT_AS_IS}" ]; then
echo "You appear to have attempted to update the PR template to define a release note."
else
echo "You have not made any changes for release notes in your PR description. Edit your PR description per the instructions at https://raw.githubusercontent.com/shipwright-io/cli/main/.github/pull_request_template.md"
exit 1
fi
echo "Now checking against valid structure for release notes"
MATCHES=$(wget -q -O- https://api.github.com/repos/shipwright-io/cli/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/cli/main/.github/pull_request_template.md"
exit 1
else
echo "Your Release Notes are properly in place!"
fi

0 comments on commit 9a759d6

Please sign in to comment.