-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
821e629
commit 9372f83
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Verify changelog updated | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check for Change Log Modification | ||
run: | | ||
changed_files=$(git diff --name-only HEAD~1..HEAD) | ||
changelog_modified=$(echo "$changed_files" | grep '^CHANGELOG.rst$' || true) | ||
python_or_rst_modified=$(echo "$changed_files" | grep '.*\.\(rst\|py\)$' || true) | ||
if [ -z "$changelog_modified" ] && [ ! -z "$python_or_rst_modified" ] | ||
then | ||
echo "Error: Changelog not modified while .rst or .py files have been modified" | ||
exit 1 | ||
else | ||
echo "Changelog modified or no .rst/.py files have been modified" | ||
fi |