tc.extractZip() failure due to tc.downloadTool() not adding .zip extension
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
If no destination is provided when calling tc.downloadTool(), this function defaults to <tempDir>/<uuidv4>. This creates a destination file that doesn't have any file extension, which can apparently cause a subsequent call to tc.extractZip() to fail, with an error like the following:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath 'C:\actions-runner\_work\_temp\0f5cb3c0-ca78-43d2-9bf3-19b379b1f416' -DestinationPath 'C:\actions-runner\_work\_temp\882ce538-f7ae-45ef-adc9-32c2ee3cd5e1' -Force } else {[System.IO.Compression.ZipFile]::ExtractToDirectory('C:\actions-runner\_work\_temp\0f5cb3c0-ca78-43d2-9bf3-19b379b1f416', 'C:\actions-runner\_work\_temp\882ce538-f7ae-45ef-adc9-32c2ee3cd5e1', $true) }"
Expand-Archive : is not a supported archive file format. .zip is the only supported archive file format.
Expected behavior
After downloading a proper zip-file with tc.downloadTool(), tc.extractZip() should run without any errors.
Either:
tc.downloadTool()should default to a destination file that has the same file extension as provided in the givenurltc.extractZip()should add a.zipextension if necessary- Both of the above
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the tc.downloadTool() and tc.extractZip() entry points and trace how their temporary destinations are chosen and passed to archive extraction. Reproduce the Windows failure with a ZIP URL and verify that downloading and extracting a ZIP without an explicit destination completes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100