Skip to content

Commit

Permalink
feat: cleanup destination directory if we fail during streaming of th…
Browse files Browse the repository at this point in the history
…e extraction
  • Loading branch information
NlightNFotis committed Dec 9, 2024
1 parent 51e71f8 commit 4c20d4f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion lib/tools-download.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/tools-download.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/tools-download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 4c20d4f

Please sign in to comment.