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