Skip to content

Commit afd5b02

Browse files
JonZeollaclaude
andcommitted
fix: use PowerShell for WSL Docker steps to handle Windows paths
Git Bash strips backslashes when passing paths to wsl commands. Use PowerShell to convert RUNNER_TEMP to WSL /mnt/ path format. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent de8b5fe commit afd5b02

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -241,22 +241,25 @@ jobs:
241241
docker buildx create --use
242242
"
243243
- name: Build Docker image
244-
shell: bash
244+
shell: pwsh
245245
run: |
246-
wsl_project="$(wsl -d Ubuntu-24.04 -- wslpath "$RUNNER_TEMP")/replace-me"
247-
wsl -d Ubuntu-24.04 -u root --cd "$wsl_project" -- docker buildx build \
248-
--platform linux/amd64 \
249-
--pull --load \
250-
--build-arg NAME=replace_me \
251-
--build-arg "DESCRIPTION=A brief description of the project" \
252-
--build-arg "TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
253-
--build-arg COMMIT_HASH=smoke-test \
246+
# Convert Windows path to WSL path (e.g. D:\a\_temp → /mnt/d/a/_temp)
247+
$drive = "$env:RUNNER_TEMP"[0].ToString().ToLower()
248+
$rest = "$env:RUNNER_TEMP".Substring(3).Replace('\', '/')
249+
$wslProject = "/mnt/$drive/$rest/replace-me"
250+
Write-Host "Building from WSL path: $wslProject"
251+
wsl -d Ubuntu-24.04 -u root --cd $wslProject -- docker buildx build `
252+
--platform linux/amd64 `
253+
--pull --load `
254+
--build-arg NAME=replace_me `
255+
--build-arg "DESCRIPTION=A brief description of the project" `
256+
--build-arg COMMIT_HASH=smoke-test `
254257
-t zenable-io/replace-me:latest .
255258
- name: Verify Docker image
256-
shell: bash
259+
shell: pwsh
257260
run: |
258-
wsl -d Ubuntu-24.04 -u root -- docker run --rm --entrypoint python3 \
259-
zenable-io/replace-me:latest \
261+
wsl -d Ubuntu-24.04 -u root -- docker run --rm --entrypoint python3 `
262+
zenable-io/replace-me:latest `
260263
-c "from replace_me import __version__; print(__version__)"
261264
- name: Verify zenable CLI
262265
shell: bash

0 commit comments

Comments
 (0)