Delete downloaded archive after extracting it during install

This commit is contained in:
Disyer 2025-04-21 12:59:51 +03:00
parent 6ed2c67c8a
commit 171df76505
4 changed files with 21 additions and 0 deletions

View file

@ -18,6 +18,7 @@ import {
getBinaryDirectory,
getDownloadFileName
} from './utils';
import {rm} from '@actions/io/lib/io-util';
export async function installPyPy(
pypyVersion: string,
@ -81,6 +82,9 @@ export async function installPyPy(
downloadDir = await tc.extractTar(pypyPath, undefined, 'x');
}
core.info('Deleting downloaded archive...');
await rm(pypyPath);
// root folder in archive can have unpredictable name so just take the first folder
// downloadDir is unique folder under TEMP and can't contain any other folders
const archiveName = fs.readdirSync(downloadDir)[0];