Skip to content

Commit de9b504

Browse files
authored
Add GitHub Actions workflow to check for changelog entry (#47)
* Add GitHub Actions workflow to check for changelog entry * Update CHANGELOG.md
1 parent 8b19b63 commit de9b504

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check for CHANGELOG.md Update
2+
3+
permissions:
4+
contents: read
5+
6+
on: [pull_request]
7+
8+
jobs:
9+
check-changelog:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out the repository
13+
uses: actions/checkout@v3
14+
15+
- name: Get the list of modified files
16+
id: changed-files
17+
run: |
18+
git fetch origin ${{ github.base_ref }} --depth=1
19+
git diff --name-only origin/${{ github.base_ref }} ${{ github.sha }} > changed_files.txt
20+
cat changed_files.txt
21+
22+
- name: Check if CHANGELOG.md was updated
23+
run: |
24+
if ! grep -q "^CHANGELOG.md$" changed_files.txt; then
25+
echo "::error::CHANGELOG.md was not updated!"
26+
exit 1
27+
else
28+
echo "CHANGELOG.md has been updated."
29+
fi

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
88

99
- added documentation for color assignments in `CONTRIBUTING.md` to standardize the use of color variables in bash scripts
1010
- added detailed color definitions and a usage example in the new "Color Assignments" section
11+
- added Github Action to check if Pull Request contains `CHANGELOG.md` updates
1112

1213
---
1314

0 commit comments

Comments
 (0)