Skip to content

[WIP] add check to see if release notes was modified #13

[WIP] add check to see if release notes was modified

[WIP] add check to see if release notes was modified #13

name: Guarantee release notes are provided
on:
workflow_dispatch:
push:
branches: [ main, dev, dajusto/validate-release-notes-are-provided ]
paths:
- '*'
pull_request:
branches: [ main, dev, dajusto/validate-release-notes-are-provided ]
types: [labeled, unlabeled]
paths:
- '.github/workflows/guarantee-release-notes.yml'
jobs:
build:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'does-not-need-release-note') }}
steps:
- uses: actions/checkout@v2
- name: Check for release_notes.md changes
id: check_changes
run: |
echo "Checking for changes in release_notes.md..."
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q 'release_notes.md'; then
echo "release_notes.md was modified. "
echo "MODIFIED=true" >> $GITHUB_ENV
else
echo "release_notes.md was NOT modified."
echo "MODIFIED=false" >> $GITHUB_ENV
fi
- name: Fail if release_notes.md was not modified
if: env.MODIFIED == 'false'
run: |
echo {{github.event.pull_request.labels.*.name.*.name}}
echo "Error: release_notes.md must be updated in this PR."
exit 1