Skip to content

Commit 3d8766f

Browse files
Copilotbackportbot[bot]
authored andcommitted
fix: skip deploy PR when only lastupdated timestamps or epub/pdf changed
When Sphinx rebuilds documentation without any content changes, it still updates the `<span class="lastupdated">` date in every HTML file and regenerates epub/pdf binaries. This caused a noisy automated PR (e.g. #15046) with no meaningful content change. The `has_changes` check in the deploy job now ignores: - HTML lines matching `lastupdated` or `Last updated on` - epub and pdf binary files (which regenerate alongside HTML) If all changes fall into those categories, no PR is created.
1 parent de84bc3 commit 3d8766f

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
@@ -571,11 +571,17 @@ jobs:
571571
# Cleanup empty directories
572572
find . -type d -empty -delete
573573
574-
# Check if there are actual changes
575-
if git diff --quiet HEAD; then
576-
echo "has_changes=false" >> $GITHUB_OUTPUT
577-
else
574+
# Check for meaningful changes, ignoring:
575+
# - lastupdated date lines in HTML (Sphinx build-time timestamps)
576+
# - epub/pdf binaries (they regenerate automatically alongside HTML)
577+
meaningful_html=$(git diff HEAD -- '*.html' | grep -E '^[+-]' | grep -v '^[+-]{3}' | grep -v 'lastupdated\|Last updated on' | wc -l)
578+
other_changes=$(git diff --name-only HEAD | grep -cvE '\.(html|epub|pdf)$' || true)
579+
580+
if [ "$meaningful_html" -gt 0 ] || [ "$other_changes" -gt 0 ]; then
578581
echo "has_changes=true" >> $GITHUB_OUTPUT
582+
else
583+
echo "has_changes=false" >> $GITHUB_OUTPUT
584+
echo "Skipping PR: only lastupdated timestamps or epub/pdf binaries changed"
579585
fi
580586
581587
- name: Strip noindex from stable docs

0 commit comments

Comments
 (0)