From cac5926de5e2c542638262c4e24527972023cdec Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 18 Nov 2025 18:10:09 +0000 Subject: [PATCH] Delete unused exports --- lib/analyze-action-post.js | 25 +++++----- lib/analyze-action.js | 25 +++++----- lib/autobuild-action.js | 25 +++++----- lib/init-action-post.js | 25 +++++----- lib/init-action.js | 25 +++++----- lib/resolve-environment-action.js | 25 +++++----- lib/setup-codeql-action.js | 25 +++++----- lib/start-proxy-action-post.js | 25 +++++----- lib/start-proxy-action.js | 25 +++++----- lib/upload-lib.js | 27 +++++----- lib/upload-sarif-action-post.js | 25 +++++----- lib/upload-sarif-action.js | 25 +++++----- src/actions-util.ts | 2 +- src/analyses.ts | 2 +- src/api-client.ts | 5 -- src/cli-errors.ts | 5 +- src/codeql.ts | 4 +- src/config-utils.ts | 8 +-- src/dependency-caching.ts | 2 +- src/environment.ts | 14 ------ src/git-utils.ts | 61 ----------------------- src/overlay-database-utils.ts | 2 +- src/setup-codeql.ts | 23 +-------- src/start-proxy.ts | 4 +- src/status-report.ts | 2 +- src/tools-download.ts | 2 +- src/tracer-config.ts | 2 +- src/upload-lib.ts | 2 +- src/util.ts | 83 ------------------------------- 29 files changed, 163 insertions(+), 362 deletions(-) diff --git a/lib/analyze-action-post.js b/lib/analyze-action-post.js index 6da36a092..4f4f64b0a 100644 --- a/lib/analyze-action-post.js +++ b/lib/analyze-action-post.js @@ -19419,7 +19419,7 @@ var require_exec = __commonJS({ exports2.getExecOutput = exports2.exec = void 0; var string_decoder_1 = require("string_decoder"); var tr = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { + function exec(commandLine, args, options) { return __awaiter4(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { @@ -19431,8 +19431,8 @@ var require_exec = __commonJS({ return runner.exec(); }); } - exports2.exec = exec2; - function getExecOutput2(commandLine, args, options) { + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { var _a, _b; return __awaiter4(this, void 0, void 0, function* () { let stdout = ""; @@ -19454,7 +19454,7 @@ var require_exec = __commonJS({ } }; const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); stdout += stdoutDecoder.end(); stderr += stderrDecoder.end(); return { @@ -19464,7 +19464,7 @@ var require_exec = __commonJS({ }; }); } - exports2.getExecOutput = getExecOutput2; + exports2.getExecOutput = getExecOutput; } }); @@ -19532,12 +19532,12 @@ var require_platform = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; var os_1 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { silent: true }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { silent: true }); return { @@ -19547,7 +19547,7 @@ var require_platform = __commonJS({ }); var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { silent: true }); const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; @@ -19558,7 +19558,7 @@ var require_platform = __commonJS({ }; }); var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { silent: true }); const [name, version] = stdout.trim().split("\n"); @@ -33934,7 +33934,7 @@ var require_cacheUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; var core14 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var glob2 = __importStar4(require_glob()); var io6 = __importStar4(require_io3()); var crypto = __importStar4(require("crypto")); @@ -34018,7 +34018,7 @@ var require_cacheUtils = __commonJS({ additionalArgs.push("--version"); core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { - yield exec2.exec(`${app}`, additionalArgs, { + yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, silent: true, listeners: { @@ -116554,7 +116554,6 @@ var io2 = __toESM(require_io2()); // src/util.ts var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); var io = __toESM(require_io2()); // node_modules/get-folder-size/index.js diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 22666ed2a..ff0b4db29 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -19419,7 +19419,7 @@ var require_exec = __commonJS({ exports2.getExecOutput = exports2.exec = void 0; var string_decoder_1 = require("string_decoder"); var tr = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { + function exec(commandLine, args, options) { return __awaiter4(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { @@ -19431,8 +19431,8 @@ var require_exec = __commonJS({ return runner.exec(); }); } - exports2.exec = exec2; - function getExecOutput2(commandLine, args, options) { + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { var _a, _b; return __awaiter4(this, void 0, void 0, function* () { let stdout = ""; @@ -19454,7 +19454,7 @@ var require_exec = __commonJS({ } }; const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); stdout += stdoutDecoder.end(); stderr += stderrDecoder.end(); return { @@ -19464,7 +19464,7 @@ var require_exec = __commonJS({ }; }); } - exports2.getExecOutput = getExecOutput2; + exports2.getExecOutput = getExecOutput; } }); @@ -19532,12 +19532,12 @@ var require_platform = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; var os_1 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { silent: true }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { silent: true }); return { @@ -19547,7 +19547,7 @@ var require_platform = __commonJS({ }); var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { silent: true }); const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; @@ -19558,7 +19558,7 @@ var require_platform = __commonJS({ }; }); var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { silent: true }); const [name, version] = stdout.trim().split("\n"); @@ -33934,7 +33934,7 @@ var require_cacheUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; var core15 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var glob2 = __importStar4(require_glob()); var io7 = __importStar4(require_io3()); var crypto2 = __importStar4(require("crypto")); @@ -34018,7 +34018,7 @@ var require_cacheUtils = __commonJS({ additionalArgs.push("--version"); core15.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { - yield exec2.exec(`${app}`, additionalArgs, { + yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, silent: true, listeners: { @@ -84336,7 +84336,6 @@ var fsPromises = __toESM(require("fs/promises")); var os = __toESM(require("os")); var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); var io = __toESM(require_io2()); // node_modules/get-folder-size/index.js diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 19055f637..725f9c8e1 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -19419,7 +19419,7 @@ var require_exec = __commonJS({ exports2.getExecOutput = exports2.exec = void 0; var string_decoder_1 = require("string_decoder"); var tr = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { + function exec(commandLine, args, options) { return __awaiter4(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { @@ -19431,8 +19431,8 @@ var require_exec = __commonJS({ return runner.exec(); }); } - exports2.exec = exec2; - function getExecOutput2(commandLine, args, options) { + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { var _a, _b; return __awaiter4(this, void 0, void 0, function* () { let stdout = ""; @@ -19454,7 +19454,7 @@ var require_exec = __commonJS({ } }; const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); stdout += stdoutDecoder.end(); stderr += stderrDecoder.end(); return { @@ -19464,7 +19464,7 @@ var require_exec = __commonJS({ }; }); } - exports2.getExecOutput = getExecOutput2; + exports2.getExecOutput = getExecOutput; } }); @@ -19532,12 +19532,12 @@ var require_platform = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; var os_1 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { silent: true }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { silent: true }); return { @@ -19547,7 +19547,7 @@ var require_platform = __commonJS({ }); var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { silent: true }); const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; @@ -19558,7 +19558,7 @@ var require_platform = __commonJS({ }; }); var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { silent: true }); const [name, version] = stdout.trim().split("\n"); @@ -33934,7 +33934,7 @@ var require_cacheUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; var core14 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var glob = __importStar4(require_glob()); var io5 = __importStar4(require_io3()); var crypto = __importStar4(require("crypto")); @@ -34018,7 +34018,7 @@ var require_cacheUtils = __commonJS({ additionalArgs.push("--version"); core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { - yield exec2.exec(`${app}`, additionalArgs, { + yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, silent: true, listeners: { @@ -80332,7 +80332,6 @@ var io2 = __toESM(require_io2()); var fsPromises = __toESM(require("fs/promises")); var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); var io = __toESM(require_io2()); // node_modules/get-folder-size/index.js diff --git a/lib/init-action-post.js b/lib/init-action-post.js index 5857024ff..298746d93 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -19419,7 +19419,7 @@ var require_exec = __commonJS({ exports2.getExecOutput = exports2.exec = void 0; var string_decoder_1 = require("string_decoder"); var tr = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { + function exec(commandLine, args, options) { return __awaiter4(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { @@ -19431,8 +19431,8 @@ var require_exec = __commonJS({ return runner.exec(); }); } - exports2.exec = exec2; - function getExecOutput2(commandLine, args, options) { + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { var _a, _b; return __awaiter4(this, void 0, void 0, function* () { let stdout = ""; @@ -19454,7 +19454,7 @@ var require_exec = __commonJS({ } }; const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); stdout += stdoutDecoder.end(); stderr += stderrDecoder.end(); return { @@ -19464,7 +19464,7 @@ var require_exec = __commonJS({ }; }); } - exports2.getExecOutput = getExecOutput2; + exports2.getExecOutput = getExecOutput; } }); @@ -19532,12 +19532,12 @@ var require_platform = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; var os_1 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { silent: true }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { silent: true }); return { @@ -19547,7 +19547,7 @@ var require_platform = __commonJS({ }); var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { silent: true }); const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; @@ -19558,7 +19558,7 @@ var require_platform = __commonJS({ }; }); var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { silent: true }); const [name, version] = stdout.trim().split("\n"); @@ -33934,7 +33934,7 @@ var require_cacheUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; var core18 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var glob2 = __importStar4(require_glob()); var io7 = __importStar4(require_io3()); var crypto = __importStar4(require("crypto")); @@ -34018,7 +34018,7 @@ var require_cacheUtils = __commonJS({ additionalArgs.push("--version"); core18.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { - yield exec2.exec(`${app}`, additionalArgs, { + yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, silent: true, listeners: { @@ -119452,7 +119452,6 @@ var fs = __toESM(require("fs")); var fsPromises = __toESM(require("fs/promises")); var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); var io = __toESM(require_io2()); // node_modules/get-folder-size/index.js diff --git a/lib/init-action.js b/lib/init-action.js index 267a67e31..c3199ca3f 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -19419,7 +19419,7 @@ var require_exec = __commonJS({ exports2.getExecOutput = exports2.exec = void 0; var string_decoder_1 = require("string_decoder"); var tr = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { + function exec(commandLine, args, options) { return __awaiter4(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { @@ -19431,8 +19431,8 @@ var require_exec = __commonJS({ return runner.exec(); }); } - exports2.exec = exec2; - function getExecOutput2(commandLine, args, options) { + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { var _a, _b; return __awaiter4(this, void 0, void 0, function* () { let stdout = ""; @@ -19454,7 +19454,7 @@ var require_exec = __commonJS({ } }; const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); stdout += stdoutDecoder.end(); stderr += stderrDecoder.end(); return { @@ -19464,7 +19464,7 @@ var require_exec = __commonJS({ }; }); } - exports2.getExecOutput = getExecOutput2; + exports2.getExecOutput = getExecOutput; } }); @@ -19532,12 +19532,12 @@ var require_platform = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; var os_1 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { silent: true }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { silent: true }); return { @@ -19547,7 +19547,7 @@ var require_platform = __commonJS({ }); var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { silent: true }); const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; @@ -19558,7 +19558,7 @@ var require_platform = __commonJS({ }; }); var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { silent: true }); const [name, version] = stdout.trim().split("\n"); @@ -34085,7 +34085,7 @@ var require_cacheUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; var core14 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var glob2 = __importStar4(require_glob()); var io7 = __importStar4(require_io3()); var crypto2 = __importStar4(require("crypto")); @@ -34169,7 +34169,7 @@ var require_cacheUtils = __commonJS({ additionalArgs.push("--version"); core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { - yield exec2.exec(`${app}`, additionalArgs, { + yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, silent: true, listeners: { @@ -81641,7 +81641,6 @@ var fsPromises = __toESM(require("fs/promises")); var os = __toESM(require("os")); var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); var io = __toESM(require_io2()); // node_modules/get-folder-size/index.js diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index d5769de3a..3a4dd9efd 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -19419,7 +19419,7 @@ var require_exec = __commonJS({ exports2.getExecOutput = exports2.exec = void 0; var string_decoder_1 = require("string_decoder"); var tr = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { + function exec(commandLine, args, options) { return __awaiter4(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { @@ -19431,8 +19431,8 @@ var require_exec = __commonJS({ return runner.exec(); }); } - exports2.exec = exec2; - function getExecOutput2(commandLine, args, options) { + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { var _a, _b; return __awaiter4(this, void 0, void 0, function* () { let stdout = ""; @@ -19454,7 +19454,7 @@ var require_exec = __commonJS({ } }; const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); stdout += stdoutDecoder.end(); stderr += stderrDecoder.end(); return { @@ -19464,7 +19464,7 @@ var require_exec = __commonJS({ }; }); } - exports2.getExecOutput = getExecOutput2; + exports2.getExecOutput = getExecOutput; } }); @@ -19532,12 +19532,12 @@ var require_platform = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; var os_1 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { silent: true }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { silent: true }); return { @@ -19547,7 +19547,7 @@ var require_platform = __commonJS({ }); var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { silent: true }); const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; @@ -19558,7 +19558,7 @@ var require_platform = __commonJS({ }; }); var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { silent: true }); const [name, version] = stdout.trim().split("\n"); @@ -33934,7 +33934,7 @@ var require_cacheUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; var core13 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var glob = __importStar4(require_glob()); var io5 = __importStar4(require_io3()); var crypto = __importStar4(require("crypto")); @@ -34018,7 +34018,7 @@ var require_cacheUtils = __commonJS({ additionalArgs.push("--version"); core13.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { - yield exec2.exec(`${app}`, additionalArgs, { + yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, silent: true, listeners: { @@ -80332,7 +80332,6 @@ var io2 = __toESM(require_io2()); var fsPromises = __toESM(require("fs/promises")); var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); var io = __toESM(require_io2()); // node_modules/get-folder-size/index.js diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index b9577ce2a..eebe3d104 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -19419,7 +19419,7 @@ var require_exec = __commonJS({ exports2.getExecOutput = exports2.exec = void 0; var string_decoder_1 = require("string_decoder"); var tr = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { + function exec(commandLine, args, options) { return __awaiter4(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { @@ -19431,8 +19431,8 @@ var require_exec = __commonJS({ return runner.exec(); }); } - exports2.exec = exec2; - function getExecOutput2(commandLine, args, options) { + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { var _a, _b; return __awaiter4(this, void 0, void 0, function* () { let stdout = ""; @@ -19454,7 +19454,7 @@ var require_exec = __commonJS({ } }; const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); stdout += stdoutDecoder.end(); stderr += stderrDecoder.end(); return { @@ -19464,7 +19464,7 @@ var require_exec = __commonJS({ }; }); } - exports2.getExecOutput = getExecOutput2; + exports2.getExecOutput = getExecOutput; } }); @@ -19532,12 +19532,12 @@ var require_platform = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; var os_1 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { silent: true }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { silent: true }); return { @@ -19547,7 +19547,7 @@ var require_platform = __commonJS({ }); var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { silent: true }); const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; @@ -19558,7 +19558,7 @@ var require_platform = __commonJS({ }; }); var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { silent: true }); const [name, version] = stdout.trim().split("\n"); @@ -32637,7 +32637,7 @@ var require_cacheUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; var core13 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var glob = __importStar4(require_glob()); var io6 = __importStar4(require_io3()); var crypto = __importStar4(require("crypto")); @@ -32721,7 +32721,7 @@ var require_cacheUtils = __commonJS({ additionalArgs.push("--version"); core13.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { - yield exec2.exec(`${app}`, additionalArgs, { + yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, silent: true, listeners: { @@ -80388,7 +80388,6 @@ var fs = __toESM(require("fs")); var fsPromises = __toESM(require("fs/promises")); var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); var io = __toESM(require_io2()); // node_modules/get-folder-size/index.js diff --git a/lib/start-proxy-action-post.js b/lib/start-proxy-action-post.js index 894cec283..59854ff22 100644 --- a/lib/start-proxy-action-post.js +++ b/lib/start-proxy-action-post.js @@ -19419,7 +19419,7 @@ var require_exec = __commonJS({ exports2.getExecOutput = exports2.exec = void 0; var string_decoder_1 = require("string_decoder"); var tr = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { + function exec(commandLine, args, options) { return __awaiter4(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { @@ -19431,8 +19431,8 @@ var require_exec = __commonJS({ return runner.exec(); }); } - exports2.exec = exec2; - function getExecOutput2(commandLine, args, options) { + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { var _a, _b; return __awaiter4(this, void 0, void 0, function* () { let stdout = ""; @@ -19454,7 +19454,7 @@ var require_exec = __commonJS({ } }; const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); stdout += stdoutDecoder.end(); stderr += stderrDecoder.end(); return { @@ -19464,7 +19464,7 @@ var require_exec = __commonJS({ }; }); } - exports2.getExecOutput = getExecOutput2; + exports2.getExecOutput = getExecOutput; } }); @@ -19532,12 +19532,12 @@ var require_platform = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; var os_1 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { silent: true }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { silent: true }); return { @@ -19547,7 +19547,7 @@ var require_platform = __commonJS({ }); var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { silent: true }); const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; @@ -19558,7 +19558,7 @@ var require_platform = __commonJS({ }; }); var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { silent: true }); const [name, version] = stdout.trim().split("\n"); @@ -33934,7 +33934,7 @@ var require_cacheUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; var core14 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var glob2 = __importStar4(require_glob()); var io6 = __importStar4(require_io3()); var crypto = __importStar4(require("crypto")); @@ -34018,7 +34018,7 @@ var require_cacheUtils = __commonJS({ additionalArgs.push("--version"); core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { - yield exec2.exec(`${app}`, additionalArgs, { + yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, silent: true, listeners: { @@ -116551,7 +116551,6 @@ var io2 = __toESM(require_io2()); // src/util.ts var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); var io = __toESM(require_io2()); // node_modules/get-folder-size/index.js diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index 378fe7c8a..e23d99449 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -19419,7 +19419,7 @@ var require_exec = __commonJS({ exports2.getExecOutput = exports2.exec = void 0; var string_decoder_1 = require("string_decoder"); var tr = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { + function exec(commandLine, args, options) { return __awaiter4(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { @@ -19431,8 +19431,8 @@ var require_exec = __commonJS({ return runner.exec(); }); } - exports2.exec = exec2; - function getExecOutput2(commandLine, args, options) { + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { var _a, _b; return __awaiter4(this, void 0, void 0, function* () { let stdout = ""; @@ -19454,7 +19454,7 @@ var require_exec = __commonJS({ } }; const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); stdout += stdoutDecoder.end(); stderr += stderrDecoder.end(); return { @@ -19464,7 +19464,7 @@ var require_exec = __commonJS({ }; }); } - exports2.getExecOutput = getExecOutput2; + exports2.getExecOutput = getExecOutput; } }); @@ -19532,12 +19532,12 @@ var require_platform = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; var os_1 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { silent: true }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { silent: true }); return { @@ -19547,7 +19547,7 @@ var require_platform = __commonJS({ }); var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { silent: true }); const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; @@ -19558,7 +19558,7 @@ var require_platform = __commonJS({ }; }); var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { silent: true }); const [name, version] = stdout.trim().split("\n"); @@ -53592,7 +53592,7 @@ var require_cacheUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; var core12 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var glob = __importStar4(require_glob()); var io4 = __importStar4(require_io4()); var crypto = __importStar4(require("crypto")); @@ -53676,7 +53676,7 @@ var require_cacheUtils = __commonJS({ additionalArgs.push("--version"); core12.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { - yield exec2.exec(`${app}`, additionalArgs, { + yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, silent: true, listeners: { @@ -96767,7 +96767,6 @@ var io2 = __toESM(require_io3()); // src/util.ts var fsPromises = __toESM(require("fs/promises")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); var io = __toESM(require_io3()); // node_modules/get-folder-size/index.js diff --git a/lib/upload-lib.js b/lib/upload-lib.js index a0881cc10..6f5d62a8c 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -19419,7 +19419,7 @@ var require_exec = __commonJS({ exports2.getExecOutput = exports2.exec = void 0; var string_decoder_1 = require("string_decoder"); var tr = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { + function exec(commandLine, args, options) { return __awaiter4(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { @@ -19431,8 +19431,8 @@ var require_exec = __commonJS({ return runner.exec(); }); } - exports2.exec = exec2; - function getExecOutput2(commandLine, args, options) { + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { var _a, _b; return __awaiter4(this, void 0, void 0, function* () { let stdout = ""; @@ -19454,7 +19454,7 @@ var require_exec = __commonJS({ } }; const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); stdout += stdoutDecoder.end(); stderr += stderrDecoder.end(); return { @@ -19464,7 +19464,7 @@ var require_exec = __commonJS({ }; }); } - exports2.getExecOutput = getExecOutput2; + exports2.getExecOutput = getExecOutput; } }); @@ -19532,12 +19532,12 @@ var require_platform = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; var os_1 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { silent: true }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { silent: true }); return { @@ -19547,7 +19547,7 @@ var require_platform = __commonJS({ }); var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { silent: true }); const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; @@ -19558,7 +19558,7 @@ var require_platform = __commonJS({ }; }); var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { silent: true }); const [name, version] = stdout.trim().split("\n"); @@ -33934,7 +33934,7 @@ var require_cacheUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; var core12 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var glob = __importStar4(require_glob()); var io6 = __importStar4(require_io3()); var crypto = __importStar4(require("crypto")); @@ -34018,7 +34018,7 @@ var require_cacheUtils = __commonJS({ additionalArgs.push("--version"); core12.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { - yield exec2.exec(`${app}`, additionalArgs, { + yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, silent: true, listeners: { @@ -83221,7 +83221,6 @@ __export(upload_lib_exports, { buildPayload: () => buildPayload, findSarifFilesInDir: () => findSarifFilesInDir, getGroupedSarifFilePaths: () => getGroupedSarifFilePaths, - getSarifFilePaths: () => getSarifFilePaths, populateRunAutomationDetails: () => populateRunAutomationDetails, postProcessSarifFiles: () => postProcessSarifFiles, readSarifFile: () => readSarifFile, @@ -83257,7 +83256,6 @@ var io2 = __toESM(require_io2()); var fs = __toESM(require("fs")); var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); var io = __toESM(require_io2()); // node_modules/get-folder-size/index.js @@ -90652,7 +90650,6 @@ function filterAlertsByDiffRange(logger, sarif) { buildPayload, findSarifFilesInDir, getGroupedSarifFilePaths, - getSarifFilePaths, populateRunAutomationDetails, postProcessSarifFiles, readSarifFile, diff --git a/lib/upload-sarif-action-post.js b/lib/upload-sarif-action-post.js index 55a3abf8c..8f64f60ef 100644 --- a/lib/upload-sarif-action-post.js +++ b/lib/upload-sarif-action-post.js @@ -19419,7 +19419,7 @@ var require_exec = __commonJS({ exports2.getExecOutput = exports2.exec = void 0; var string_decoder_1 = require("string_decoder"); var tr = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { + function exec(commandLine, args, options) { return __awaiter4(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { @@ -19431,8 +19431,8 @@ var require_exec = __commonJS({ return runner.exec(); }); } - exports2.exec = exec2; - function getExecOutput2(commandLine, args, options) { + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { var _a, _b; return __awaiter4(this, void 0, void 0, function* () { let stdout = ""; @@ -19454,7 +19454,7 @@ var require_exec = __commonJS({ } }; const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); stdout += stdoutDecoder.end(); stderr += stderrDecoder.end(); return { @@ -19464,7 +19464,7 @@ var require_exec = __commonJS({ }; }); } - exports2.getExecOutput = getExecOutput2; + exports2.getExecOutput = getExecOutput; } }); @@ -19532,12 +19532,12 @@ var require_platform = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; var os_1 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { silent: true }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { silent: true }); return { @@ -19547,7 +19547,7 @@ var require_platform = __commonJS({ }); var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { silent: true }); const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; @@ -19558,7 +19558,7 @@ var require_platform = __commonJS({ }; }); var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { silent: true }); const [name, version] = stdout.trim().split("\n"); @@ -108407,7 +108407,7 @@ var require_cacheUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; var core14 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var glob2 = __importStar4(require_glob2()); var io6 = __importStar4(require_io3()); var crypto = __importStar4(require("crypto")); @@ -108491,7 +108491,7 @@ var require_cacheUtils = __commonJS({ additionalArgs.push("--version"); core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { - yield exec2.exec(`${app}`, additionalArgs, { + yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, silent: true, listeners: { @@ -116551,7 +116551,6 @@ var io2 = __toESM(require_io2()); // src/util.ts var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); var io = __toESM(require_io2()); // node_modules/get-folder-size/index.js diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 25f9547cc..8a115e6b4 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -19419,7 +19419,7 @@ var require_exec = __commonJS({ exports2.getExecOutput = exports2.exec = void 0; var string_decoder_1 = require("string_decoder"); var tr = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { + function exec(commandLine, args, options) { return __awaiter4(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { @@ -19431,8 +19431,8 @@ var require_exec = __commonJS({ return runner.exec(); }); } - exports2.exec = exec2; - function getExecOutput2(commandLine, args, options) { + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { var _a, _b; return __awaiter4(this, void 0, void 0, function* () { let stdout = ""; @@ -19454,7 +19454,7 @@ var require_exec = __commonJS({ } }; const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); stdout += stdoutDecoder.end(); stderr += stderrDecoder.end(); return { @@ -19464,7 +19464,7 @@ var require_exec = __commonJS({ }; }); } - exports2.getExecOutput = getExecOutput2; + exports2.getExecOutput = getExecOutput; } }); @@ -19532,12 +19532,12 @@ var require_platform = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; var os_1 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { silent: true }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { silent: true }); return { @@ -19547,7 +19547,7 @@ var require_platform = __commonJS({ }); var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { silent: true }); const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; @@ -19558,7 +19558,7 @@ var require_platform = __commonJS({ }; }); var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { silent: true }); const [name, version] = stdout.trim().split("\n"); @@ -32637,7 +32637,7 @@ var require_cacheUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; var core14 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); + var exec = __importStar4(require_exec()); var glob = __importStar4(require_glob()); var io6 = __importStar4(require_io3()); var crypto = __importStar4(require("crypto")); @@ -32721,7 +32721,7 @@ var require_cacheUtils = __commonJS({ additionalArgs.push("--version"); core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { - yield exec2.exec(`${app}`, additionalArgs, { + yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, silent: true, listeners: { @@ -83230,7 +83230,6 @@ var fs = __toESM(require("fs")); var fsPromises = __toESM(require("fs/promises")); var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); var io = __toESM(require_io2()); // node_modules/get-folder-size/index.js diff --git a/src/actions-util.ts b/src/actions-util.ts index a2d691b42..736d35d0f 100644 --- a/src/actions-util.ts +++ b/src/actions-util.ts @@ -80,7 +80,7 @@ export function isRunningLocalAction(): boolean { * * This can be used to get the Action's name or tell if we're running a local Action. */ -export function getRelativeScriptPath(): string { +function getRelativeScriptPath(): string { const runnerTemp = getRequiredEnvParam("RUNNER_TEMP"); const actionsDirectory = path.join(path.dirname(runnerTemp), "_actions"); return path.relative(actionsDirectory, __filename); diff --git a/src/analyses.ts b/src/analyses.ts index a8d172e3b..4f91ab07c 100644 --- a/src/analyses.ts +++ b/src/analyses.ts @@ -98,7 +98,7 @@ export async function getAnalysisKinds( export const codeQualityQueries: string[] = ["code-quality"]; // Enumerates API endpoints that accept SARIF files. -export enum SARIF_UPLOAD_ENDPOINT { +enum SARIF_UPLOAD_ENDPOINT { CODE_SCANNING = "PUT /repos/:owner/:repo/code-scanning/analysis", CODE_QUALITY = "PUT /repos/:owner/:repo/code-quality/analysis", } diff --git a/src/api-client.ts b/src/api-client.ts index e14048337..600da1ed6 100644 --- a/src/api-client.ts +++ b/src/api-client.ts @@ -18,11 +18,6 @@ import { const GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version"; -export enum DisallowedAPIVersionReason { - ACTION_TOO_OLD, - ACTION_TOO_NEW, -} - export type GitHubApiCombinedDetails = GitHubApiDetails & GitHubApiExternalRepoDetails; diff --git a/src/cli-errors.ts b/src/cli-errors.ts index 0a009f983..5aba268ca 100644 --- a/src/cli-errors.ts +++ b/src/cli-errors.ts @@ -159,10 +159,7 @@ type CliErrorConfiguration = { * All of our caught CLI error messages that we handle specially: ie. if we * would like to categorize an error as a configuration error or not. */ -export const cliErrorsConfig: Record< - CliConfigErrorCategory, - CliErrorConfiguration -> = { +const cliErrorsConfig: Record = { [CliConfigErrorCategory.AutobuildError]: { cliErrorMessageCandidates: [ new RegExp("We were unable to automatically build your code"), diff --git a/src/codeql.ts b/src/codeql.ts index bc1d00401..17db0ef2c 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -513,7 +513,7 @@ export async function getCodeQLForTesting( * version requirement. Must be set to true outside tests. * @returns A new CodeQL object */ -export async function getCodeQLForCmd( +async function getCodeQLForCmd( cmd: string, checkVersion: boolean, ): Promise { @@ -1222,7 +1222,7 @@ export async function getTrapCachingExtractorConfigArgsForLang( * * This will not exist if the configuration is being parsed in the Action. */ -export function getGeneratedCodeScanningConfigPath(config: Config): string { +function getGeneratedCodeScanningConfigPath(config: Config): string { return path.resolve(config.tempDir, "user-config.yaml"); } diff --git a/src/config-utils.ts b/src/config-utils.ts index 03608fb1a..016bc4868 100644 --- a/src/config-utils.ts +++ b/src/config-utils.ts @@ -179,7 +179,7 @@ export interface Config { repositoryProperties: RepositoryProperties; } -export async function getSupportedLanguageMap( +async function getSupportedLanguageMap( codeql: CodeQL, logger: Logger, ): Promise> { @@ -242,7 +242,7 @@ export function hasActionsWorkflows(sourceRoot: string): boolean { /** * Gets the set of languages in the current repository. */ -export async function getRawLanguagesInRepo( +async function getRawLanguagesInRepo( repository: RepositoryNwo, sourceRoot: string, logger: Logger, @@ -351,7 +351,7 @@ export function getRawLanguagesNoAutodetect( * @returns A tuple containing a list of languages in this repository that might be * analyzable and whether or not this list was determined automatically. */ -export async function getRawLanguages( +async function getRawLanguages( languagesInput: string | undefined, repository: RepositoryNwo, sourceRoot: string, @@ -1230,7 +1230,7 @@ export function isCodeQualityEnabled(config: Config): boolean { * @returns Returns `AnalysisKind.CodeScanning` if `AnalysisKind.CodeScanning` is enabled; * otherwise `AnalysisKind.CodeQuality`. */ -export function getPrimaryAnalysisKind(config: Config): AnalysisKind { +function getPrimaryAnalysisKind(config: Config): AnalysisKind { return isCodeScanningEnabled(config) ? AnalysisKind.CodeScanning : AnalysisKind.CodeQuality; diff --git a/src/dependency-caching.ts b/src/dependency-caching.ts index 9f6aa2afc..350d8e468 100644 --- a/src/dependency-caching.ts +++ b/src/dependency-caching.ts @@ -55,7 +55,7 @@ export function getJavaTempDependencyDir(): string { * @returns The paths of directories on the runner that should be included in a dependency cache * for a Java analysis. */ -export function getJavaDependencyDirs(): string[] { +function getJavaDependencyDirs(): string[] { return [ // Maven join(os.homedir(), ".m2", "repository"), diff --git a/src/environment.ts b/src/environment.ts index 16a016aaa..1d33c68a6 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -20,12 +20,6 @@ export enum EnvVar { /** Whether the CodeQL Action has invoked the Go autobuilder. */ DID_AUTOBUILD_GOLANG = "CODEQL_ACTION_DID_AUTOBUILD_GOLANG", - /** - * Whether to disable the SARIF post-processing in the Action that removes duplicate locations from - * notifications in the `run[].invocations[].toolExecutionNotifications` SARIF property. - */ - DISABLE_DUPLICATE_LOCATION_FIX = "CODEQL_ACTION_DISABLE_DUPLICATE_LOCATION_FIX", - /** * Whether the CodeQL Action is using its own deprecated and non-standard way of scanning for * multiple languages. @@ -56,20 +50,12 @@ export enum EnvVar { /** Whether the error for a deprecated version of the CodeQL Action was logged. */ LOG_VERSION_DEPRECATION = "CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION", - /** - * For macOS. Result of `csrutil status` to determine whether System Integrity - * Protection is enabled. - */ - IS_SIP_ENABLED = "CODEQL_ACTION_IS_SIP_ENABLED", - /** UUID representing the current job run. */ JOB_RUN_UUID = "JOB_RUN_UUID", /** Status for the entire job, submitted to the status report in `init-post` */ JOB_STATUS = "CODEQL_ACTION_JOB_STATUS", - ODASA_TRACER_CONFIGURATION = "ODASA_TRACER_CONFIGURATION", - /** The value of the `output` input for the analyze action. */ SARIF_RESULTS_OUTPUT_DIR = "CODEQL_ACTION_SARIF_RESULTS_OUTPUT_DIR", diff --git a/src/git-utils.ts b/src/git-utils.ts index 837124027..0d2a7df7a 100644 --- a/src/git-utils.ts +++ b/src/git-utils.ts @@ -122,67 +122,6 @@ export const determineBaseBranchHeadCommitOid = async function ( } }; -/** - * Deepen the git history of HEAD by one level. Errors are logged. - * - * This function uses the `checkout_path` to determine the repository path and - * works only when called from `analyze` or `upload-sarif`. - */ -export const deepenGitHistory = async function () { - try { - await runGitCommand( - getOptionalInput("checkout_path"), - [ - "fetch", - "origin", - "HEAD", - "--no-tags", - "--no-recurse-submodules", - "--deepen=1", - ], - "Cannot deepen the shallow repository.", - ); - } catch { - // Errors are already logged by runGitCommand() - } -}; - -/** - * Fetch the given remote branch. Errors are logged. - * - * This function uses the `checkout_path` to determine the repository path and - * works only when called from `analyze` or `upload-sarif`. - */ -export const gitFetch = async function (branch: string, extraFlags: string[]) { - try { - await runGitCommand( - getOptionalInput("checkout_path"), - ["fetch", "--no-tags", ...extraFlags, "origin", `${branch}:${branch}`], - `Cannot fetch ${branch}.`, - ); - } catch { - // Errors are already logged by runGitCommand() - } -}; - -/** - * Repack the git repository, using with the given flags. Errors are logged. - * - * This function uses the `checkout_path` to determine the repository path and - * works only when called from `analyze` or `upload-sarif`. - */ -export const gitRepack = async function (flags: string[]) { - try { - await runGitCommand( - getOptionalInput("checkout_path"), - ["repack", ...flags], - "Cannot repack the repository.", - ); - } catch { - // Errors are already logged by runGitCommand() - } -}; - /** * Decode, if necessary, a file path produced by Git. See * https://git-scm.com/docs/git-config#Documentation/git-config.txt-corequotePath diff --git a/src/overlay-database-utils.ts b/src/overlay-database-utils.ts index ebb020ba8..71990ccc3 100644 --- a/src/overlay-database-utils.ts +++ b/src/overlay-database-utils.ts @@ -175,7 +175,7 @@ const MAX_CACHE_OPERATION_MS = 600_000; * @param warningPrefix Prefix for the check failure warning message * @returns True if the verification succeeded, false otherwise */ -export function checkOverlayBaseDatabase( +function checkOverlayBaseDatabase( config: Config, logger: Logger, warningPrefix: string, diff --git a/src/setup-codeql.ts b/src/setup-codeql.ts index 948893022..6a412d1df 100644 --- a/src/setup-codeql.ts +++ b/src/setup-codeql.ts @@ -34,7 +34,7 @@ export enum ToolsSource { Download = "DOWNLOAD", } -export const CODEQL_DEFAULT_ACTION_REPOSITORY = "github/codeql-action"; +const CODEQL_DEFAULT_ACTION_REPOSITORY = "github/codeql-action"; const CODEQL_NIGHTLIES_REPOSITORY_OWNER = "dsp-testing"; const CODEQL_NIGHTLIES_REPOSITORY_NAME = "codeql-cli-nightlies"; @@ -180,17 +180,6 @@ export function tryGetTagNameFromUrl( return match[1]; } -export function tryGetBundleVersionFromUrl( - url: string, - logger: Logger, -): string | undefined { - const tagName = tryGetTagNameFromUrl(url, logger); - if (tagName === undefined) { - return undefined; - } - return tryGetBundleVersionFromTagName(tagName, logger); -} - export function convertToSemVer(version: string, logger: Logger): string { if (!semver.valid(version)) { logger.debug( @@ -580,7 +569,7 @@ export async function getCodeQLSource( * Gets a fallback version number to use when looking for CodeQL in the toolcache if we didn't find * the `x.y.z` version. This is to support old versions of the toolcache. */ -export async function tryGetFallbackToolcacheVersion( +async function tryGetFallbackToolcacheVersion( cliVersion: string | undefined, tagName: string, logger: Logger, @@ -729,14 +718,6 @@ function getCanonicalToolcacheVersion( return cliVersion; } -export interface SetupCodeQLResult { - codeqlFolder: string; - toolsDownloadStatusReport?: ToolsDownloadStatusReport; - toolsSource: ToolsSource; - toolsVersion: string; - zstdAvailability: tar.ZstdAvailability; -} - /** * Obtains the CodeQL bundle, installs it in the toolcache if appropriate, and extracts it. * diff --git a/src/start-proxy.ts b/src/start-proxy.ts index 2888e1a58..2a082ed62 100644 --- a/src/start-proxy.ts +++ b/src/start-proxy.ts @@ -8,7 +8,7 @@ import { ConfigurationError, getErrorMessage, isDefined } from "./util"; export const UPDATEJOB_PROXY = "update-job-proxy"; export const UPDATEJOB_PROXY_VERSION = "v2.0.20250624110901"; -export const UPDATEJOB_PROXY_URL_PREFIX = +const UPDATEJOB_PROXY_URL_PREFIX = "https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.22.0/"; export type Credential = { @@ -202,7 +202,7 @@ export function getFallbackUrl(proxyPackage: string): string { * * @returns The response from the GitHub API. */ -export async function getLinkedRelease() { +async function getLinkedRelease() { return getApiClient().rest.repos.getReleaseByTag({ owner: "github", repo: "codeql-action", diff --git a/src/status-report.ts b/src/status-report.ts index 1ad53ac32..c6e747489 100644 --- a/src/status-report.ts +++ b/src/status-report.ts @@ -54,7 +54,7 @@ export enum ActionName { * considered to be a third party analysis and is treated differently when calculating SLOs. To ensure * misconfigured workflows are not treated as third party, only the upload-sarif action can return false. */ -export function isFirstPartyAnalysis(actionName: ActionName): boolean { +function isFirstPartyAnalysis(actionName: ActionName): boolean { if (actionName !== ActionName.UploadSarif) { return true; } diff --git a/src/tools-download.ts b/src/tools-download.ts index 4cfba397e..5d8a4c5fb 100644 --- a/src/tools-download.ts +++ b/src/tools-download.ts @@ -17,7 +17,7 @@ import { cleanUpPath, getErrorMessage, getRequiredEnvParam } from "./util"; /** * High watermark to use when streaming the download and extraction of the CodeQL tools. */ -export const STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; // 4 MiB +const STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; // 4 MiB /** * The name of the tool cache directory for the CodeQL tools. diff --git a/src/tracer-config.ts b/src/tracer-config.ts index 9eea3eecc..d786d4651 100644 --- a/src/tracer-config.ts +++ b/src/tracer-config.ts @@ -76,7 +76,7 @@ export async function endTracingForCluster( } } -export async function getTracerConfigForCluster( +async function getTracerConfigForCluster( config: Config, ): Promise { const tracingEnvVariables = JSON.parse( diff --git a/src/upload-lib.ts b/src/upload-lib.ts index f032b8327..ac0274520 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -412,7 +412,7 @@ export function findSarifFilesInDir( return sarifFiles; } -export function getSarifFilePaths( +function getSarifFilePaths( sarifPath: string, isSarif: (name: string) => boolean, ) { diff --git a/src/util.ts b/src/util.ts index f23c3be7d..fe8604b46 100644 --- a/src/util.ts +++ b/src/util.ts @@ -4,7 +4,6 @@ import * as os from "os"; import * as path from "path"; import * as core from "@actions/core"; -import * as exec from "@actions/exec/lib/exec"; import * as io from "@actions/io"; import getFolderSize from "get-folder-size"; import * as yaml from "js-yaml"; @@ -1026,34 +1025,6 @@ export function fixInvalidNotifications( return newSarif; } -/** - * Removes duplicates from the sarif file. - * - * When `CODEQL_ACTION_DISABLE_DUPLICATE_LOCATION_FIX` is set to true, this will - * simply rename the input file to the output file. Otherwise, it will parse the - * input file as JSON, remove duplicate locations from the SARIF notification - * objects, and write the result to the output file. - * - * For context, see documentation of: - * `CODEQL_ACTION_DISABLE_DUPLICATE_LOCATION_FIX`. */ -export function fixInvalidNotificationsInFile( - inputPath: string, - outputPath: string, - logger: Logger, -): void { - if (process.env[EnvVar.DISABLE_DUPLICATE_LOCATION_FIX] === "true") { - logger.info( - "SARIF notification object duplicate location fix disabled by the " + - `${EnvVar.DISABLE_DUPLICATE_LOCATION_FIX} environment variable.`, - ); - fs.renameSync(inputPath, outputPath); - } else { - let sarif = JSON.parse(fs.readFileSync(inputPath, "utf8")) as SarifFile; - sarif = fixInvalidNotifications(sarif, logger); - fs.writeFileSync(outputPath, JSON.stringify(sarif)); - } -} - export function wrapError(error: unknown): Error { return error instanceof Error ? error : new Error(String(error)); } @@ -1197,49 +1168,6 @@ export function cloneObject(obj: T): T { return JSON.parse(JSON.stringify(obj)) as T; } -// The first time this function is called, it runs `csrutil status` to determine -// whether System Integrity Protection is enabled; and saves the result in an -// environment variable. Afterwards, simply return the value of the environment -// variable. -export async function checkSipEnablement( - logger: Logger, -): Promise { - if ( - process.env[EnvVar.IS_SIP_ENABLED] !== undefined && - ["true", "false"].includes(process.env[EnvVar.IS_SIP_ENABLED]) - ) { - return process.env[EnvVar.IS_SIP_ENABLED] === "true"; - } - - try { - const sipStatusOutput = await exec.getExecOutput("csrutil status"); - if (sipStatusOutput.exitCode === 0) { - if ( - sipStatusOutput.stdout.includes( - "System Integrity Protection status: enabled.", - ) - ) { - core.exportVariable(EnvVar.IS_SIP_ENABLED, "true"); - return true; - } - if ( - sipStatusOutput.stdout.includes( - "System Integrity Protection status: disabled.", - ) - ) { - core.exportVariable(EnvVar.IS_SIP_ENABLED, "false"); - return false; - } - } - return undefined; - } catch (e) { - logger.warning( - `Failed to determine if System Integrity Protection was enabled: ${e}`, - ); - return undefined; - } -} - export async function cleanUpPath(file: string, name: string, logger: Logger) { logger.debug(`Cleaning up ${name}.`); try { @@ -1291,17 +1219,6 @@ export function isDefined(value: T | null | undefined): value is T { return value !== undefined && value !== null; } -/** Like `Object.keys`, but typed so that the elements of the resulting array have the - * same type as the keys of the input object. Note that this may not be sound if the input - * object has been cast to `T` from a subtype of `T` and contains additional keys that - * are not represented by `keyof T`. - */ -export function unsafeKeysInvariant>( - object: T, -): Array { - return Object.keys(object) as Array; -} - /** Like `Object.entries`, but typed so that the key elements of the result have the * same type as the keys of the input object. Note that this may not be sound if the input * object has been cast to `T` from a subtype of `T` and contains additional keys that