Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add workflow #4948

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/check_changelog.yaml
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
Loading