Skip to content

Commit edfaa21

Browse files
Fix auto check documentation action (#69)
1 parent f455176 commit edfaa21

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/auto_review_documentation.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ jobs:
4141
id: changed-docs
4242
run: |
4343
# Retrieve list of files changed between the previous commit and the current SHA
44-
git diff --name-only ${{ github.event.before }} ${{ github.sha }} > changed_files.txt
45-
# filter to include only documentation files (e.g., .md, .rst, README, .ipynb)
46-
grep -E "${DOC_FILE_FILTER}" changed_files.txt || true > changed_docs.txt
44+
# --diff-filter=d exclude deleted files
45+
git diff --name-only --diff-filter=d ${{ github.event.before }} ${{ github.sha }} > changed_files.txt
46+
# filter to include only documentation files
47+
# -i ignore case
48+
grep -i -E "${DOC_FILE_FILTER}" changed_files.txt > changed_docs.txt || > changed_docs.txt
49+
4750
echo "Files changed with DOC_FILE_FILTER (${DOC_FILE_FILTER}) — could be empty:"
4851
echo "---------------------------------------------------------------"
4952
cat changed_docs.txt

0 commit comments

Comments
 (0)