Skip to content

Commit bae9f29

Browse files
authored
Improve notebook change detection in workflow
1 parent 2e6a259 commit bae9f29

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/render-notebooks.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,14 @@ jobs:
4545
- name: Check for changes
4646
id: git-check
4747
run: |
48-
if [[ -n "$(git status --porcelain **/*.ipynb)" ]]; then
49-
echo "has_changes=true" >> $GITHUB_OUTPUT
50-
else
48+
# More reliable way to check for changes in notebooks
49+
git update-index --refresh
50+
if git diff-index --quiet HEAD -- "*.ipynb"; then
51+
echo "No changes detected in notebooks"
5152
echo "has_changes=false" >> $GITHUB_OUTPUT
53+
else
54+
echo "Changes detected in notebooks"
55+
echo "has_changes=true" >> $GITHUB_OUTPUT
5256
fi
5357
5458
- name: Show modified files

0 commit comments

Comments
 (0)