Skip to content

Use Go 1.22 in GitHub Actions #403

Use Go 1.22 in GitHub Actions

Use Go 1.22 in GitHub Actions #403

---
name: Release Note Linter
on:
pull_request:
branches:
- main
jobs:
release-notes-linter:
runs-on: ubuntu-latest
steps:
- name: Sanity Check Release Notes
if: github.actor != 'dependabot[bot]'
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