Update README.md #7
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: Verify CHANGELOG Updated | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
check-changelog: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Ensure full history is fetched | |
- name: Ensure CHANGELOG.md is updated | |
run: | | |
# Fetch the base branch to compare against | |
git fetch origin ${{ github.base_ref }} --depth=1 | |
# Compare changes between the current branch and the base branch | |
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}) | |
# Check if CHANGELOG.md is included in the list of changed files | |
if echo "$CHANGED_FILES" | grep -q 'CHANGELOG.md'; then | |
echo "CHANGELOG.md is updated." | |
else | |
echo "ERROR: Please update the CHANGELOG.md file with your changes." && exit 1 | |
fi |