Skip to content

Commit d1e2a0f

Browse files
committed
feat: Add GitHub Action to verify CHANGELOG.md updates in pull requests
1 parent 42eee3f commit d1e2a0f

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Check Changelog
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
7+
jobs:
8+
check-changelog:
9+
name: Verify Changelog Update
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Check for CHANGELOG.md modification
18+
run: |
19+
# Fetch the base branch to ensure we can diff against it
20+
git fetch origin ${{ github.base_ref }}
21+
22+
# Check if CHANGELOG.md is in the list of changed files
23+
if git diff --name-only origin/${{ github.base_ref }} ${{ github.event.pull_request.head.sha }} | grep -q "^CHANGELOG.md$"; then
24+
echo "✅ CHANGELOG.md has been modified."
25+
exit 0
26+
else
27+
echo "❌ Error: CHANGELOG.md was not modified in this Pull Request."
28+
echo "Please add an entry to CHANGELOG.md describing your changes."
29+
exit 1
30+
fi

0 commit comments

Comments
 (0)