Skip to content

Commit 6ce4ffa

Browse files
JonZeollaclaude
andcommitted
ci: pre-populate cookiecutter cache to work around NTFS clone issue
Cookiecutter's gh: syntax does git clone of the default branch first, which fails on Windows when main still has NTFS-illegal paths. Pre-clone with --no-checkout and checkout the PR branch to seed the cache. The actual cookiecutter command remains the same as the README. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ee9b7f5 commit 6ce4ffa

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@ jobs:
129129
git config --global user.name "CI Automation"
130130
git config --global user.email "ci@zenable.io"
131131
132+
# Pre-populate cookiecutter's cache so the gh: command doesn't need to
133+
# clone main (which may still have NTFS-illegal paths before this PR merges).
134+
# After merge, this is a no-op since the cache will already be valid.
135+
repo_name=$(basename "${TEMPLATE_REPO}")
136+
cache_dir="$HOME/.cookiecutters/${repo_name}"
137+
if [[ ! -d "$cache_dir" ]]; then
138+
git clone --no-checkout "https://github.com/${TEMPLATE_REPO}.git" "$cache_dir"
139+
git -C "$cache_dir" checkout "${TEMPLATE_REF}"
140+
fi
141+
132142
# Same command as README, plus --checkout for the PR branch and --no-input for CI
133143
uvx --with gitpython cookiecutter \
134144
"gh:${TEMPLATE_REPO}" \

0 commit comments

Comments
 (0)