1
0
Fork 0
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:
Priya Gupta 2024-08-05 22:53:34 +05:30 committed by GitHub
parent 04c1311429
commit 036a523674
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 77 additions and 8 deletions

View file

@ -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;
}