Throw warning if CHANGELOG.md
file has not been modified
#6
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 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 |