mirror of
https://github.com/actions/setup-go.git
synced 2025-06-28 07:53:43 +00:00
Use explicit filename when downloading Windows go package
Using the explicit filename for Windows is necessary to satisfy `Expand-Archive`'s requirement on '.zip' extension. Signed-off-by: Javier Romero <root@jromero.codes>
This commit is contained in:
parent
f2e56d8191
commit
e0dce94eb0
3 changed files with 52 additions and 2 deletions
|
@ -132,7 +132,13 @@ async function installGoVersion(
|
|||
auth: string | undefined
|
||||
): Promise<string> {
|
||||
core.info(`Acquiring ${info.resolvedVersion} from ${info.downloadUrl}`);
|
||||
const downloadPath = await tc.downloadTool(info.downloadUrl, undefined, auth);
|
||||
|
||||
// Windows requires that we keep the extension (.zip) for extraction
|
||||
const isWindows = os.platform() === 'win32';
|
||||
const tempDir = process.env.RUNNER_TEMP || '.';
|
||||
const fileName = isWindows ? path.join(tempDir, info.fileName) : undefined;
|
||||
|
||||
const downloadPath = await tc.downloadTool(info.downloadUrl, fileName, auth);
|
||||
|
||||
core.info('Extracting Go...');
|
||||
let extPath = await extractGoArchive(downloadPath);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue