From d36b2521aebac44b6fb0ce07dd641c34dc855ffa Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Wed, 8 Jul 2026 08:53:03 +0200 Subject: [PATCH] ci: strip stable noindex before pruning deploy noise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The prune step reverts files whose only diff versus gh-pages is build noise. Stable pages are the canonical indexed version, so their noindex robots meta is stripped after deploy — HEAD has no noindex, but a fresh Sphinx build does. With the strip running after the prune, every rebuilt stable file still carried that meta at prune time, counted as a real change, and was kept. The later strip then removed the meta, leaving the file differing from HEAD by only the build timestamp — exactly the noise the prune was meant to drop. Result: the stable folder shipped hundreds of timestamp-only files (e.g. 255 in one deploy) while 32/33/34, which are never stripped, pruned correctly. Move the noindex strip ahead of the prune so noise-only stable pages match HEAD and get reverted like every other version. Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: skjnldsv --- .github/workflows/deploy-docs.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index c77888fca35..c3fd36b98b2 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -178,6 +178,18 @@ jobs: # Cleanup empty directories find . -type d -empty -delete + # Strip noindex from stable docs BEFORE pruning. Sphinx always emits a + # noindex robots meta, but the deployed stable pages have it stripped + # (they are the canonical, indexed version). If we pruned first, every + # rebuilt stable file would still carry that meta and so differ from + # HEAD by a "real" line — defeating the prune and leaving timestamp-only + # files in the PR. Stripping first makes noise-only stable pages match + # HEAD, so the prune below can revert them. + if [ -d server/stable ]; then + find server/stable -name '*.html' -print0 | \ + xargs -0 perl -pi -e 's{\n?}{}g' + fi + # ---------------------------------------------------------------- # Prune build-only noise so the PR carries exclusively real content # changes. A rebuilt page differs every night even when its content @@ -237,15 +249,6 @@ jobs: echo "::notice::Skipping deploy PR: only build noise (timestamps, mermaid ids, binaries) changed" fi - - name: Strip noindex from stable docs - if: steps.apply.outputs.has_changes == 'true' - run: | - # Strip noindex from stable docs – these are the canonical pages we want indexed - if [ -d server/stable ]; then - find server/stable -name '*.html' -print0 | \ - xargs -0 perl -pi -e 's{\n?}{}g' - fi - - name: Write robots.txt if: steps.apply.outputs.has_changes == 'true' run: |