Skip to content

Throw warning if CHANGELOG.md file has not been modified #6

Throw warning if CHANGELOG.md file has not been modified

Throw warning if CHANGELOG.md file has not been modified #6

Workflow file for this run

name: Check Changelog Update
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
check-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 2 # Fetch the last 2 commits to ensure we can compare with the previous commit
- name: Check if CHANGELOG.md is modified
run: |
if git diff --name-only HEAD^ HEAD | grep -q '^CHANGELOG.md$'; then
echo "CHANGELOG.md has been modified."
else
echo "::error file=CHANGELOG.md::CHANGELOG.md has not been modified."
exit 1
fi