Skip to content

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

Throw warning if CHANGELOG.md file has not been modified

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

Workflow file for this run

name: Changelog
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
check-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Check if CHANGELOG.md is modified
run: |
# Get the list of changed files in the PR
changed_files=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }}...${{ github.sha }})
echo changed_files
# Check if CHANGELOG.md is in the list of changed files
if echo "$changed_files" | grep -q '^CHANGELOG.md$'; then
echo "CHANGELOG.md has been modified. ✅"
else
echo "::warning file=CHANGELOG.md::CHANGELOG.md has not been modified. ⚠️"
fi