Skip to content

Commit 4c20d4f

Browse files
committed
feat: cleanup destination directory if we fail during streaming of the extraction
1 parent 51e71f8 commit 4c20d4f

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

lib/tools-download.js

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/tools-download.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tools-download.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@ export async function downloadAndExtract(
127127
core.warning(
128128
`Failed to download and extract CodeQL bundle using streaming. Falling back to downloading the bundle before extracting.`,
129129
);
130-
core.warning(getErrorMessage(e));
130+
core.warning(`Error: ${getErrorMessage(e)}`);
131+
132+
// If we failed during processing, we want to clean up the destination directory
133+
// before we try again.
134+
await cleanUpGlob(dest, "CodeQL bundle", logger);
131135
}
132136

133137
const toolsDownloadStart = performance.now();

0 commit comments

Comments
 (0)