You've already forked setup-python
mirror of
https://github.com/actions/setup-python.git
synced 2025-07-15 19:40:31 +07: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:
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user