Automations - Check pull requests for changelog modification #2
Workflow file for this run
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
name: Check Changelog has been updated | |
on: | |
pull_request: | |
types: [opened, edited, synchronize] | |
jobs: | |
changelog-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Check if changelog has been updated | |
run: | | |
if ! git diff --name-only origin/main...HEAD | grep -q '\.github\CHANGELOG.md'; then | |
echo "Changelog not updated. Please update .github/CHANGELOG.md" >&2 | |
exit 1 | |
fi | |
- name: Notify success | |
if: success() | |
run: echo "Changelog has been updated." |