Skip to content

Commit 7cbd226

Browse files
authored
Merge pull request #216 from fulll/fix/docs-snapshot-merge-pathspec-glob
Fix snapshot merge never matching gh-pages versioned dirs
2 parents f66dd80 + 077eb06 commit 7cbd226

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎.github/workflows/docs.yaml‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ jobs:
8383
set -euo pipefail
8484
if git ls-remote --heads origin gh-pages | grep -q gh-pages; then
8585
git fetch origin gh-pages
86-
# List only top-level entries that match v<integer> (e.g. v1, v2).
87-
# Using a pathspec glob and a strict regex avoids iterating over
88-
# unrelated files (.nojekyll, README, etc.) at the branch root.
89-
for entry in $(git ls-tree --name-only origin/gh-pages -- 'v[0-9]*'); do
86+
# List all top-level entries and filter with a strict regex —
87+
# `ls-tree` pathspecs are matched literally (no glob expansion,
88+
# unlike `git log`/`git diff`), so `-- 'v[0-9]*'` would silently
89+
# match nothing and skip every snapshot.
90+
for entry in $(git ls-tree --name-only origin/gh-pages); do
9091
if echo "$entry" | grep -qE '^v[0-9]+$'; then
9192
echo "Merging snapshot: $entry"
9293
mkdir -p "docs/.vitepress/dist/$entry"

0 commit comments

Comments
 (0)