From 077eb06f20f3dc120252a2cda23571e285af1a43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20HOUZ=C3=89?= Date: Sat, 19 Sep 2026 16:05:49 +0200 Subject: [PATCH] Fix snapshot merge never matching gh-pages versioned dirs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git ls-tree does not expand pathspec glob wildcards the way git log/git diff do — 'v[0-9]*' is matched literally, so it never matched anything and the deploy job's 'Merge versioned snapshots' step silently skipped every stored snapshot, including v2. This is why https://fulll.github.io/github-code-search/v2/ 404s even though the snapshot is safely stored in gh-pages. List all top-level gh-pages entries and filter with the existing grep -E regex instead of relying on the pathspec. --- .github/workflows/docs.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 6f42af1..4e2f789 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -83,10 +83,11 @@ jobs: set -euo pipefail if git ls-remote --heads origin gh-pages | grep -q gh-pages; then git fetch origin gh-pages - # List only top-level entries that match v (e.g. v1, v2). - # Using a pathspec glob and a strict regex avoids iterating over - # unrelated files (.nojekyll, README, etc.) at the branch root. - for entry in $(git ls-tree --name-only origin/gh-pages -- 'v[0-9]*'); do + # List all top-level entries and filter with a strict regex — + # `ls-tree` pathspecs are matched literally (no glob expansion, + # unlike `git log`/`git diff`), so `-- 'v[0-9]*'` would silently + # match nothing and skip every snapshot. + for entry in $(git ls-tree --name-only origin/gh-pages); do if echo "$entry" | grep -qE '^v[0-9]+$'; then echo "Merging snapshot: $entry" mkdir -p "docs/.vitepress/dist/$entry"