Skip to content

Commit 5546f82

Browse files
TGJLSclaude
andcommitted
Get Windows IP via cmd.exe ipconfig instead of powershell.exe
powershell.exe interop returns nothing; cmd.exe already proven to work (used for GITHUB_WORKSPACE). Parse the WSL adapter section of ipconfig. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 848d45e commit 5546f82

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ jobs:
165165
run: |
166166
ssh-keygen -t ed25519 -N "" -f ~/.ssh/ci_key
167167
168-
WINDOWS_IP=$(powershell.exe -noprofile -command "(Get-NetIPAddress -AddressFamily IPv4 | Where-Object {\$_.InterfaceAlias -like '*WSL*'} | Select-Object -First 1).IPAddress" 2>/dev/null | tr -d '\r\n')
168+
WINDOWS_IP=$(cmd.exe /c ipconfig 2>/dev/null | tr -d '\r' | awk '/WSL/{f=1} f && /IPv4 Address/{print $NF; exit}')
169169
170170
sshpass -p "$CI_PASS" ssh-copy-id \
171171
-i ~/.ssh/ci_key.pub \
@@ -177,7 +177,7 @@ jobs:
177177
run: |
178178
# Windows → WSL: use the WSL veth IP so the beacon can call home
179179
WSL_IP=$(hostname -I | awk '{print $1}')
180-
WINDOWS_IP=$(powershell.exe -noprofile -command "(Get-NetIPAddress -AddressFamily IPv4 | Where-Object {\$_.InterfaceAlias -like '*WSL*'} | Select-Object -First 1).IPAddress" 2>/dev/null | tr -d '\r\n')
180+
WINDOWS_IP=$(cmd.exe /c ipconfig 2>/dev/null | tr -d '\r' | awk '/WSL/{f=1} f && /IPv4 Address/{print $NF; exit}')
181181
182182
cat > /tmp/ci_config.yaml << EOF
183183
server:

0 commit comments

Comments
 (0)