Skip to content

Commit 59992d9

Browse files
authored
[windows] Always use system-shipped tar (#1)
On some Windows runners, it is possible for a GNU tar binary to be further ahead in `PATH`. In particular, Git for Windows ships with a GNU tar binary, which can't parse Windows-style paths properly. This works around the issue by always using the BSD tar binary that always ships with the operating system on Windows.
1 parent 717214c commit 59992d9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ runs:
3838
run: |
3939
New-Item -ItemType Directory -Path "${{ inputs.path }}" -Force | Out-Null
4040
$TarFile = Join-Path "${{ steps.create-temp-dir.outputs.temp-dir }}" "${{ inputs.name }}.tar"
41-
tar xf $TarFile -C ${{ inputs.path }}
41+
$tar = if ($IsWindows) { "${env:WINDIR}\System32\tar.exe" } else { "tar" }
42+
& $tar xf $TarFile -C ${{ inputs.path }}
4243
4344
- name: Delete Temporary Directory
4445
shell: pwsh

0 commit comments

Comments
 (0)