Skip to content

Commit 73b489b

Browse files
committed
Add validation for gha-find-replace actions
Fail the workflow if no files are modified during file updates. This prevents silent failures in the release process.
1 parent f0f4282 commit 73b489b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
echo "underline=${underline}" >> "$GITHUB_OUTPUT"
5353
5454
- name: Update changelog
55+
id: update_changelog
5556
uses: jacobtomlinson/gha-find-replace@v3
5657
with:
5758
find: "Next\n----"
@@ -60,6 +61,12 @@ jobs:
6061
include: CHANGELOG.rst
6162
regex: false
6263

64+
- name: Check Update changelog was modified
65+
run: |
66+
if [ "${{ steps.update_changelog.outputs.modifiedFiles }}" = "0" ]; then
67+
echo "Error: No files were modified when updating changelog"
68+
exit 1
69+
fi
6370
- uses: stefanzweifel/git-auto-commit-action@v7
6471
id: commit
6572
with:

0 commit comments

Comments
 (0)