Skip to content

Commit 6009993

Browse files
authored
Merge pull request #15060 from nextcloud/backport/15049/stable33
[stable33] fix: skip deploy PR when only lastupdated timestamps or epub/pdf changed
2 parents b5e73db + c5f2232 commit 6009993

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/sphinxbuild.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,11 +577,17 @@ jobs:
577577
# Cleanup empty directories
578578
find . -type d -empty -delete
579579
580-
# Check if there are actual changes
581-
if git diff --quiet HEAD; then
582-
echo "has_changes=false" >> $GITHUB_OUTPUT
583-
else
580+
# Check for meaningful changes, ignoring:
581+
# - lastupdated date lines in HTML (Sphinx build-time timestamps)
582+
# - epub/pdf binaries (they regenerate automatically alongside HTML)
583+
meaningful_html=$(git diff HEAD -- '*.html' | grep -E '^[+-]' | grep -v '^[+-]{3}' | grep -ivE 'lastupdated|Last updated on' | wc -l)
584+
other_changes=$(git diff --name-only HEAD | grep -cvE '\.(html|epub|pdf)$' || true)
585+
586+
if [ "$meaningful_html" -gt 0 ] || [ "$other_changes" -gt 0 ]; then
584587
echo "has_changes=true" >> $GITHUB_OUTPUT
588+
else
589+
echo "has_changes=false" >> $GITHUB_OUTPUT
590+
echo "::notice::Skipping deploy PR: only lastupdated timestamps or epub/pdf binaries changed"
585591
fi
586592
587593
- name: Strip noindex from stable docs

0 commit comments

Comments
 (0)