feat: cleanup destination directory if we fail during streaming of the extraction

This commit is contained in:
Fotis Koutoulakis (@NlightNFotis) 2024-12-09 19:13:05 +00:00
parent 51e71f81a0
commit 4c20d4f58a
3 changed files with 10 additions and 3 deletions

View file

@ -127,7 +127,11 @@ export async function downloadAndExtract(
core.warning(
`Failed to download and extract CodeQL bundle using streaming. Falling back to downloading the bundle before extracting.`,
);
core.warning(getErrorMessage(e));
core.warning(`Error: ${getErrorMessage(e)}`);
// If we failed during processing, we want to clean up the destination directory
// before we try again.
await cleanUpGlob(dest, "CodeQL bundle", logger);
}
const toolsDownloadStart = performance.now();