diff --git a/lib/analyze-action.js b/lib/analyze-action.js index f12d73777..1ba59615e 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -83381,10 +83381,10 @@ async function checkSipEnablement(logger) { return void 0; } } -async function cleanUpGlob(glob2, name, logger) { +async function cleanUpPath(file, name, logger) { logger.debug(`Cleaning up ${name}.`); try { - await fs.promises.rm(glob2, { + await fs.promises.rm(file, { force: true, recursive: true }); @@ -85564,7 +85564,7 @@ async function extractTarZst(tar, dest, tarVersion, logger) { }); }); } catch (e) { - await cleanUpGlob(dest, "extraction destination directory", logger); + await cleanUpPath(dest, "extraction destination directory", logger); throw e; } } @@ -85644,7 +85644,7 @@ async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorizat `Failed to download and extract CodeQL bundle using streaming with error: ${getErrorMessage(e)}` ); core9.warning(`Falling back to downloading the bundle before extracting.`); - await cleanUpGlob(dest, "CodeQL bundle", logger); + await cleanUpPath(dest, "CodeQL bundle", logger); } const toolsDownloadStart = import_perf_hooks.performance.now(); const archivedBundlePath = await toolcache2.downloadTool( @@ -85677,7 +85677,7 @@ async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorizat )}).` ); } finally { - await cleanUpGlob(archivedBundlePath, "CodeQL bundle archive", logger); + await cleanUpPath(archivedBundlePath, "CodeQL bundle archive", logger); } return { compressionMethod, diff --git a/lib/init-action-post.js b/lib/init-action-post.js index 23fdb2c60..fcccf61a4 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -121643,10 +121643,10 @@ async function checkSipEnablement(logger) { return void 0; } } -async function cleanUpGlob(glob2, name, logger) { +async function cleanUpPath(file, name, logger) { logger.debug(`Cleaning up ${name}.`); try { - await fs.promises.rm(glob2, { + await fs.promises.rm(file, { force: true, recursive: true }); @@ -123406,7 +123406,7 @@ async function extractTarZst(tar, dest, tarVersion, logger) { }); }); } catch (e) { - await cleanUpGlob(dest, "extraction destination directory", logger); + await cleanUpPath(dest, "extraction destination directory", logger); throw e; } } @@ -123486,7 +123486,7 @@ async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorizat `Failed to download and extract CodeQL bundle using streaming with error: ${getErrorMessage(e)}` ); core9.warning(`Falling back to downloading the bundle before extracting.`); - await cleanUpGlob(dest, "CodeQL bundle", logger); + await cleanUpPath(dest, "CodeQL bundle", logger); } const toolsDownloadStart = import_perf_hooks.performance.now(); const archivedBundlePath = await toolcache2.downloadTool( @@ -123519,7 +123519,7 @@ async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorizat )}).` ); } finally { - await cleanUpGlob(archivedBundlePath, "CodeQL bundle archive", logger); + await cleanUpPath(archivedBundlePath, "CodeQL bundle archive", logger); } return { compressionMethod, diff --git a/lib/init-action.js b/lib/init-action.js index 9a3a5e15d..bacce8851 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -80702,10 +80702,10 @@ async function checkSipEnablement(logger) { return void 0; } } -async function cleanUpGlob(glob2, name, logger) { +async function cleanUpPath(file, name, logger) { logger.debug(`Cleaning up ${name}.`); try { - await fs.promises.rm(glob2, { + await fs.promises.rm(file, { force: true, recursive: true }); @@ -83728,7 +83728,7 @@ async function extractTarZst(tar, dest, tarVersion, logger) { }); }); } catch (e) { - await cleanUpGlob(dest, "extraction destination directory", logger); + await cleanUpPath(dest, "extraction destination directory", logger); throw e; } } @@ -83808,7 +83808,7 @@ async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorizat `Failed to download and extract CodeQL bundle using streaming with error: ${getErrorMessage(e)}` ); core9.warning(`Falling back to downloading the bundle before extracting.`); - await cleanUpGlob(dest, "CodeQL bundle", logger); + await cleanUpPath(dest, "CodeQL bundle", logger); } const toolsDownloadStart = import_perf_hooks2.performance.now(); const archivedBundlePath = await toolcache2.downloadTool( @@ -83841,7 +83841,7 @@ async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorizat )}).` ); } finally { - await cleanUpGlob(archivedBundlePath, "CodeQL bundle archive", logger); + await cleanUpPath(archivedBundlePath, "CodeQL bundle archive", logger); } return { compressionMethod, diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index 83046fe04..5c238534e 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -79199,10 +79199,10 @@ async function checkSipEnablement(logger) { return void 0; } } -async function cleanUpGlob(glob, name, logger) { +async function cleanUpPath(file, name, logger) { logger.debug(`Cleaning up ${name}.`); try { - await fs.promises.rm(glob, { + await fs.promises.rm(file, { force: true, recursive: true }); @@ -80686,7 +80686,7 @@ async function extractTarZst(tar, dest, tarVersion, logger) { }); }); } catch (e) { - await cleanUpGlob(dest, "extraction destination directory", logger); + await cleanUpPath(dest, "extraction destination directory", logger); throw e; } } @@ -80766,7 +80766,7 @@ async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorizat `Failed to download and extract CodeQL bundle using streaming with error: ${getErrorMessage(e)}` ); core9.warning(`Falling back to downloading the bundle before extracting.`); - await cleanUpGlob(dest, "CodeQL bundle", logger); + await cleanUpPath(dest, "CodeQL bundle", logger); } const toolsDownloadStart = import_perf_hooks.performance.now(); const archivedBundlePath = await toolcache2.downloadTool( @@ -80799,7 +80799,7 @@ async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorizat )}).` ); } finally { - await cleanUpGlob(archivedBundlePath, "CodeQL bundle archive", logger); + await cleanUpPath(archivedBundlePath, "CodeQL bundle archive", logger); } return { compressionMethod, diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 857527793..1b248a960 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -81841,10 +81841,10 @@ function satisfiesGHESVersion(ghesVersion, range, defaultIfInvalid) { function cloneObject(obj) { return JSON.parse(JSON.stringify(obj)); } -async function cleanUpGlob(glob, name, logger) { +async function cleanUpPath(file, name, logger) { logger.debug(`Cleaning up ${name}.`); try { - await fs.promises.rm(glob, { + await fs.promises.rm(file, { force: true, recursive: true }); @@ -83247,7 +83247,7 @@ async function extractTarZst(tar, dest, tarVersion, logger) { }); }); } catch (e) { - await cleanUpGlob(dest, "extraction destination directory", logger); + await cleanUpPath(dest, "extraction destination directory", logger); throw e; } } @@ -83327,7 +83327,7 @@ async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorizat `Failed to download and extract CodeQL bundle using streaming with error: ${getErrorMessage(e)}` ); core9.warning(`Falling back to downloading the bundle before extracting.`); - await cleanUpGlob(dest, "CodeQL bundle", logger); + await cleanUpPath(dest, "CodeQL bundle", logger); } const toolsDownloadStart = import_perf_hooks.performance.now(); const archivedBundlePath = await toolcache2.downloadTool( @@ -83360,7 +83360,7 @@ async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorizat )}).` ); } finally { - await cleanUpGlob(archivedBundlePath, "CodeQL bundle archive", logger); + await cleanUpPath(archivedBundlePath, "CodeQL bundle archive", logger); } return { compressionMethod, diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 313f8b170..75c785dc7 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -82027,10 +82027,10 @@ async function checkSipEnablement(logger) { return void 0; } } -async function cleanUpGlob(glob, name, logger) { +async function cleanUpPath(file, name, logger) { logger.debug(`Cleaning up ${name}.`); try { - await fs.promises.rm(glob, { + await fs.promises.rm(file, { force: true, recursive: true }); @@ -83920,7 +83920,7 @@ async function extractTarZst(tar, dest, tarVersion, logger) { }); }); } catch (e) { - await cleanUpGlob(dest, "extraction destination directory", logger); + await cleanUpPath(dest, "extraction destination directory", logger); throw e; } } @@ -84000,7 +84000,7 @@ async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorizat `Failed to download and extract CodeQL bundle using streaming with error: ${getErrorMessage(e)}` ); core10.warning(`Falling back to downloading the bundle before extracting.`); - await cleanUpGlob(dest, "CodeQL bundle", logger); + await cleanUpPath(dest, "CodeQL bundle", logger); } const toolsDownloadStart = import_perf_hooks.performance.now(); const archivedBundlePath = await toolcache2.downloadTool( @@ -84033,7 +84033,7 @@ async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorizat )}).` ); } finally { - await cleanUpGlob(archivedBundlePath, "CodeQL bundle archive", logger); + await cleanUpPath(archivedBundlePath, "CodeQL bundle archive", logger); } return { compressionMethod, diff --git a/src/tar.ts b/src/tar.ts index 93e9a0554..723716b01 100644 --- a/src/tar.ts +++ b/src/tar.ts @@ -9,7 +9,7 @@ import * as semver from "semver"; import { CommandInvocationError } from "./actions-util"; import { Logger } from "./logging"; -import { assertNever, cleanUpGlob, isBinaryAccessible } from "./util"; +import { assertNever, cleanUpPath, isBinaryAccessible } from "./util"; const MIN_REQUIRED_BSD_TAR_VERSION = "3.4.3"; const MIN_REQUIRED_GNU_TAR_VERSION = "1.31"; @@ -217,7 +217,7 @@ export async function extractTarZst( }); }); } catch (e) { - await cleanUpGlob(dest, "extraction destination directory", logger); + await cleanUpPath(dest, "extraction destination directory", logger); throw e; } } diff --git a/src/tools-download.ts b/src/tools-download.ts index 5d47440ed..4cfba397e 100644 --- a/src/tools-download.ts +++ b/src/tools-download.ts @@ -12,7 +12,7 @@ import * as semver from "semver"; import { formatDuration, Logger } from "./logging"; import * as tar from "./tar"; -import { cleanUpGlob, getErrorMessage, getRequiredEnvParam } from "./util"; +import { cleanUpPath, getErrorMessage, getRequiredEnvParam } from "./util"; /** * High watermark to use when streaming the download and extraction of the CodeQL tools. @@ -130,7 +130,7 @@ export async function downloadAndExtract( // If we failed during processing, we want to clean up the destination directory // before we try again. - await cleanUpGlob(dest, "CodeQL bundle", logger); + await cleanUpPath(dest, "CodeQL bundle", logger); } const toolsDownloadStart = performance.now(); @@ -167,7 +167,7 @@ export async function downloadAndExtract( )}).`, ); } finally { - await cleanUpGlob(archivedBundlePath, "CodeQL bundle archive", logger); + await cleanUpPath(archivedBundlePath, "CodeQL bundle archive", logger); } return { diff --git a/src/util.ts b/src/util.ts index 8defde9ac..7caee46a0 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1262,10 +1262,10 @@ export async function checkSipEnablement( } } -export async function cleanUpGlob(glob: string, name: string, logger: Logger) { +export async function cleanUpPath(file: string, name: string, logger: Logger) { logger.debug(`Cleaning up ${name}.`); try { - await fs.promises.rm(glob, { + await fs.promises.rm(file, { force: true, recursive: true, });