From 8e815049fad42fc262ca795b8939b479d16366db Mon Sep 17 00:00:00 2001 From: Serene-Arc <33189705+Serene-Arc@users.noreply.github.com> Date: Mon, 16 Oct 2023 12:35:18 +1000 Subject: [PATCH] Use different method for calculating changed paths --- .github/workflows/check_changelog.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check_changelog.yaml b/.github/workflows/check_changelog.yaml index 1ceae9e42..19adc5ff8 100644 --- a/.github/workflows/check_changelog.yaml +++ b/.github/workflows/check_changelog.yaml @@ -1,6 +1,15 @@ name: Verify changelog updated -on: [push, pull_request] +on: + push: + paths: + - '**.rst' + - '**.py' + pull_request: + paths: + - '**.rst' + - '**.py' + jobs: check: @@ -14,12 +23,7 @@ jobs: - 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"