1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-06-17 16:26:06 +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

@ -4,7 +4,7 @@ import * as tc from '@actions/tool-cache';
import * as exec from '@actions/exec';
import * as httpm from '@actions/http-client';
import {ExecOptions} from '@actions/exec/lib/interfaces';
import {IS_WINDOWS, IS_LINUX} from './utils';
import {IS_WINDOWS, IS_LINUX, getDownloadFileName} from './utils';
const TOKEN = core.getInput('token');
const AUTH = !TOKEN ? undefined : `token ${TOKEN}`;
@ -98,7 +98,8 @@ export async function installCpythonFromRelease(release: tc.IToolRelease) {
core.info(`Download from "${downloadUrl}"`);
let pythonPath = '';
try {
pythonPath = await tc.downloadTool(downloadUrl, undefined, AUTH);
const fileName = getDownloadFileName(downloadUrl);
pythonPath = await tc.downloadTool(downloadUrl, fileName, AUTH);
core.info('Extract downloaded archive');
let pythonExtractedFolder;
if (IS_WINDOWS) {