mirror of
https://code.forgejo.org/actions/setup-python
synced 2025-06-23 10:58:01 +02:00
Fix: Add .zip
extension to Windows package downloads for Expand-Archive
Compatibility (#916)
* Fix: specify filename during Windows package download * Changed unit test download urls
This commit is contained in:
parent
04c1311429
commit
036a523674
5 changed files with 77 additions and 8 deletions
14
src/utils.ts
14
src/utils.ts
|
@ -310,3 +310,17 @@ export function getNextPageUrl<T>(response: ifm.TypedResponse<T>) {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add temporary fix for Windows
|
||||
* On Windows, it is necessary to retain the .zip extension for proper extraction.
|
||||
* because the tc.extractZip() failure due to tc.downloadTool() not adding .zip extension.
|
||||
* Related issue: https://github.com/actions/toolkit/issues/1179
|
||||
* Related issue: https://github.com/actions/setup-python/issues/819
|
||||
*/
|
||||
export function getDownloadFileName(downloadUrl: string): string | undefined {
|
||||
const tempDir = process.env.RUNNER_TEMP || '.';
|
||||
return IS_WINDOWS
|
||||
? path.join(tempDir, path.basename(downloadUrl))
|
||||
: undefined;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue