Skip to content

Commit 98d43ae

Browse files
JonZeollaclaude
andcommitted
ci: add local clone fallback for pre-merge Windows NTFS issue
The gh: command tries to clone main first which fails on Windows when main still has NTFS-illegal paths. Add a fallback that manually clones with --no-checkout and checks out the PR branch. After merge, the gh: command succeeds directly and the fallback is never triggered. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4095f00 commit 98d43ae

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,24 @@ jobs:
129129
git config --global user.name "CI Automation"
130130
git config --global user.email "ci@zenable.io"
131131
132-
# Allow git to clone repos with NTFS-illegal paths (e.g. pipes/quotes in
133-
# the old template directory name on main). After this PR merges, the
134-
# illegal paths are gone and this setting becomes a no-op.
135-
git config --global core.protectNTFS false
136-
137-
# Same command as README, plus --checkout for the PR branch and --no-input for CI
132+
# Use the same command as README.md (gh: syntax). On Windows, if the
133+
# default branch still has NTFS-illegal paths (pre-merge), the gh: clone
134+
# fails because cookiecutter clones main first. Fall back to a local
135+
# clone in that case. After merge, the gh: command succeeds directly.
138136
uvx --with gitpython cookiecutter \
139137
"gh:${TEMPLATE_REPO}" \
140138
--checkout "${TEMPLATE_REF}" \
141139
--no-input project_name="ci-test-project" \
142-
--output-dir "$RUNNER_TEMP"
140+
--output-dir "$RUNNER_TEMP" \
141+
|| {
142+
echo "::warning::gh: clone failed (expected pre-merge on Windows). Using local clone."
143+
template_dir="$RUNNER_TEMP/template-repo"
144+
git clone --no-checkout "https://github.com/${TEMPLATE_REPO}.git" "$template_dir"
145+
git -C "$template_dir" checkout "${TEMPLATE_REF}"
146+
uvx --with gitpython cookiecutter "$template_dir" \
147+
--no-input project_name="ci-test-project" \
148+
--output-dir "$RUNNER_TEMP"
149+
}
143150
- name: Verify generated project
144151
shell: pwsh
145152
run: |

0 commit comments

Comments
 (0)