Fix: windows arm64 setup (#1126)

* Add condition to ensure ZIP extraction targets only Windows ARM64 official archives

* Bumps micromatch from 4.0.5 to 4.0.8
This commit is contained in:
Priya Gupta
2024-09-07 01:00:34 +05:30
committed by GitHub
parent 26961cf329
commit 1c7b2db920
4 changed files with 17 additions and 12 deletions

View File

@ -150,7 +150,7 @@ export default abstract class BaseDistribution {
throw err;
}
const toolPath = await this.extractArchive(downloadPath, info);
const toolPath = await this.extractArchive(downloadPath, info, true);
core.info('Done');
return toolPath;
@ -210,7 +210,8 @@ export default abstract class BaseDistribution {
protected async extractArchive(
downloadPath: string,
info: INodeVersionInfo | null
info: INodeVersionInfo | null,
isOfficialArchive?: boolean
) {
//
// Extract
@ -225,7 +226,7 @@ export default abstract class BaseDistribution {
// on Windows runners without PowerShell Core.
//
// For default PowerShell Windows it should contain extension type to unpack it.
if (extension === '.zip') {
if (extension === '.zip' && isOfficialArchive) {
const renamedArchive = `${downloadPath}.zip`;
fs.renameSync(downloadPath, renamedArchive);
extPath = await tc.extractZip(renamedArchive);

View File

@ -88,7 +88,11 @@ export default class OfficialBuilds extends BaseDistribution {
);
if (downloadPath) {
toolPath = await this.extractArchive(downloadPath, versionInfo);
toolPath = await this.extractArchive(
downloadPath,
versionInfo,
false
);
}
} else {
core.info(