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,
getNextPageUrl
} from './utils';
import {rm} from '@actions/io/lib/io-util';
const TOKEN = core.getInput('token');
const AUTH = !TOKEN ? undefined : `token ${TOKEN}`;
@ -66,6 +67,9 @@ export async function installGraalPy(
core.info('Extracting downloaded archive...');
downloadDir = await tc.extractTar(graalpyPath);
core.info('Deleting downloaded archive...');
await rm(graalpyPath);
// 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];