mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 09:14:58 +00:00
Merge branch 'main' into henrymercer/api-logging
This commit is contained in:
277
lib/resolve-environment-action.js
generated
277
lib/resolve-environment-action.js
generated
@@ -10754,7 +10754,7 @@ var require_mock_interceptor = __commonJS({
|
||||
var require_mock_client = __commonJS({
|
||||
"node_modules/undici/lib/mock/mock-client.js"(exports2, module2) {
|
||||
"use strict";
|
||||
var { promisify: promisify2 } = require("util");
|
||||
var { promisify } = require("util");
|
||||
var Client = require_client();
|
||||
var { buildMockDispatch } = require_mock_utils();
|
||||
var {
|
||||
@@ -10794,7 +10794,7 @@ var require_mock_client = __commonJS({
|
||||
return new MockInterceptor(opts, this[kDispatches]);
|
||||
}
|
||||
async [kClose]() {
|
||||
await promisify2(this[kOriginalClose])();
|
||||
await promisify(this[kOriginalClose])();
|
||||
this[kConnected] = 0;
|
||||
this[kMockAgent][Symbols.kClients].delete(this[kOrigin]);
|
||||
}
|
||||
@@ -10807,7 +10807,7 @@ var require_mock_client = __commonJS({
|
||||
var require_mock_pool = __commonJS({
|
||||
"node_modules/undici/lib/mock/mock-pool.js"(exports2, module2) {
|
||||
"use strict";
|
||||
var { promisify: promisify2 } = require("util");
|
||||
var { promisify } = require("util");
|
||||
var Pool = require_pool();
|
||||
var { buildMockDispatch } = require_mock_utils();
|
||||
var {
|
||||
@@ -10847,7 +10847,7 @@ var require_mock_pool = __commonJS({
|
||||
return new MockInterceptor(opts, this[kDispatches]);
|
||||
}
|
||||
async [kClose]() {
|
||||
await promisify2(this[kOriginalClose])();
|
||||
await promisify(this[kOriginalClose])();
|
||||
this[kConnected] = 0;
|
||||
this[kMockAgent][Symbols.kClients].delete(this[kOrigin]);
|
||||
}
|
||||
@@ -18148,7 +18148,7 @@ var require_summary = __commonJS({
|
||||
exports2.summary = exports2.markdownSummary = exports2.SUMMARY_DOCS_URL = exports2.SUMMARY_ENV_VAR = void 0;
|
||||
var os_1 = require("os");
|
||||
var fs_1 = require("fs");
|
||||
var { access: access2, appendFile, writeFile } = fs_1.promises;
|
||||
var { access, appendFile, writeFile } = fs_1.promises;
|
||||
exports2.SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY";
|
||||
exports2.SUMMARY_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";
|
||||
var Summary = class {
|
||||
@@ -18171,7 +18171,7 @@ var require_summary = __commonJS({
|
||||
throw new Error(`Unable to find environment variable for $${exports2.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
|
||||
}
|
||||
try {
|
||||
yield access2(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
|
||||
yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
|
||||
} catch (_a) {
|
||||
throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
|
||||
}
|
||||
@@ -19846,6 +19846,7 @@ var require_context = __commonJS({
|
||||
this.action = process.env.GITHUB_ACTION;
|
||||
this.actor = process.env.GITHUB_ACTOR;
|
||||
this.job = process.env.GITHUB_JOB;
|
||||
this.runAttempt = parseInt(process.env.GITHUB_RUN_ATTEMPT, 10);
|
||||
this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
|
||||
this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
|
||||
this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
|
||||
@@ -21748,21 +21749,36 @@ var require_dist_node11 = __commonJS({
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
||||
var dist_src_exports = {};
|
||||
__export2(dist_src_exports, {
|
||||
var index_exports = {};
|
||||
__export2(index_exports, {
|
||||
Octokit: () => Octokit
|
||||
});
|
||||
module2.exports = __toCommonJS2(dist_src_exports);
|
||||
module2.exports = __toCommonJS2(index_exports);
|
||||
var import_universal_user_agent = require_dist_node();
|
||||
var import_before_after_hook = require_before_after_hook();
|
||||
var import_request = require_dist_node5();
|
||||
var import_graphql = require_dist_node9();
|
||||
var import_auth_token = require_dist_node10();
|
||||
var VERSION = "5.2.0";
|
||||
var VERSION = "5.2.2";
|
||||
var noop = () => {
|
||||
};
|
||||
var consoleWarn = console.warn.bind(console);
|
||||
var consoleError = console.error.bind(console);
|
||||
function createLogger(logger = {}) {
|
||||
if (typeof logger.debug !== "function") {
|
||||
logger.debug = noop;
|
||||
}
|
||||
if (typeof logger.info !== "function") {
|
||||
logger.info = noop;
|
||||
}
|
||||
if (typeof logger.warn !== "function") {
|
||||
logger.warn = consoleWarn;
|
||||
}
|
||||
if (typeof logger.error !== "function") {
|
||||
logger.error = consoleError;
|
||||
}
|
||||
return logger;
|
||||
}
|
||||
var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
|
||||
var Octokit = class {
|
||||
static {
|
||||
@@ -21836,15 +21852,7 @@ var require_dist_node11 = __commonJS({
|
||||
}
|
||||
this.request = import_request.request.defaults(requestDefaults);
|
||||
this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
|
||||
this.log = Object.assign(
|
||||
{
|
||||
debug: noop,
|
||||
info: noop,
|
||||
warn: consoleWarn,
|
||||
error: consoleError
|
||||
},
|
||||
options.log
|
||||
);
|
||||
this.log = createLogger(options.log);
|
||||
this.hook = hook;
|
||||
if (!options.authStrategy) {
|
||||
if (!options.auth) {
|
||||
@@ -24862,8 +24870,8 @@ var require_semver = __commonJS({
|
||||
}
|
||||
// preminor will bump the version up to the next minor release, and immediately
|
||||
// down to pre-release. premajor and prepatch work the same way.
|
||||
inc(release3, identifier, identifierBase) {
|
||||
if (release3.startsWith("pre")) {
|
||||
inc(release2, identifier, identifierBase) {
|
||||
if (release2.startsWith("pre")) {
|
||||
if (!identifier && identifierBase === false) {
|
||||
throw new Error("invalid increment argument: identifier is empty");
|
||||
}
|
||||
@@ -24874,7 +24882,7 @@ var require_semver = __commonJS({
|
||||
}
|
||||
}
|
||||
}
|
||||
switch (release3) {
|
||||
switch (release2) {
|
||||
case "premajor":
|
||||
this.prerelease.length = 0;
|
||||
this.patch = 0;
|
||||
@@ -24965,7 +24973,7 @@ var require_semver = __commonJS({
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw new Error(`invalid increment argument: ${release3}`);
|
||||
throw new Error(`invalid increment argument: ${release2}`);
|
||||
}
|
||||
this.raw = this.format();
|
||||
if (this.build.length) {
|
||||
@@ -25031,7 +25039,7 @@ var require_inc = __commonJS({
|
||||
"node_modules/semver/functions/inc.js"(exports2, module2) {
|
||||
"use strict";
|
||||
var SemVer = require_semver();
|
||||
var inc = (version, release3, options, identifier, identifierBase) => {
|
||||
var inc = (version, release2, options, identifier, identifierBase) => {
|
||||
if (typeof options === "string") {
|
||||
identifierBase = identifier;
|
||||
identifier = options;
|
||||
@@ -25041,7 +25049,7 @@ var require_inc = __commonJS({
|
||||
return new SemVer(
|
||||
version instanceof SemVer ? version.version : version,
|
||||
options
|
||||
).inc(release3, identifier, identifierBase).version;
|
||||
).inc(release2, identifier, identifierBase).version;
|
||||
} catch (er) {
|
||||
return null;
|
||||
}
|
||||
@@ -26484,7 +26492,7 @@ var require_package = __commonJS({
|
||||
},
|
||||
license: "MIT",
|
||||
dependencies: {
|
||||
"@actions/artifact": "^2.3.1",
|
||||
"@actions/artifact": "^4.0.0",
|
||||
"@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2",
|
||||
"@actions/cache": "^4.1.0",
|
||||
"@actions/core": "^1.11.1",
|
||||
@@ -26498,8 +26506,7 @@ var require_package = __commonJS({
|
||||
"@octokit/request-error": "^7.0.1",
|
||||
"@schemastore/package": "0.0.10",
|
||||
archiver: "^7.0.1",
|
||||
"check-disk-space": "^3.4.0",
|
||||
del: "^8.0.0",
|
||||
"console-log-level": "^1.4.1",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"follow-redirects": "^1.15.11",
|
||||
"get-folder-size": "^5.0.0",
|
||||
@@ -26517,8 +26524,8 @@ var require_package = __commonJS({
|
||||
"@eslint/eslintrc": "^3.3.1",
|
||||
"@eslint/js": "^9.38.0",
|
||||
"@microsoft/eslint-formatter-sarif": "^3.1.0",
|
||||
"@octokit/types": "^15.0.0",
|
||||
"@types/archiver": "^6.0.3",
|
||||
"@octokit/types": "^15.0.1",
|
||||
"@types/archiver": "^6.0.4",
|
||||
"@types/console-log-level": "^1.4.5",
|
||||
"@types/follow-redirects": "^1.14.4",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
@@ -26526,7 +26533,7 @@ var require_package = __commonJS({
|
||||
"@types/node-forge": "^1.3.14",
|
||||
"@types/semver": "^7.7.1",
|
||||
"@types/sinon": "^17.0.4",
|
||||
"@typescript-eslint/eslint-plugin": "^8.46.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
||||
"@typescript-eslint/parser": "^8.41.0",
|
||||
ava: "^6.4.1",
|
||||
esbuild: "^0.25.11",
|
||||
@@ -31387,8 +31394,8 @@ var require_semver3 = __commonJS({
|
||||
}
|
||||
} while (++i2);
|
||||
};
|
||||
SemVer.prototype.inc = function(release3, identifier) {
|
||||
switch (release3) {
|
||||
SemVer.prototype.inc = function(release2, identifier) {
|
||||
switch (release2) {
|
||||
case "premajor":
|
||||
this.prerelease.length = 0;
|
||||
this.patch = 0;
|
||||
@@ -31464,20 +31471,20 @@ var require_semver3 = __commonJS({
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new Error("invalid increment argument: " + release3);
|
||||
throw new Error("invalid increment argument: " + release2);
|
||||
}
|
||||
this.format();
|
||||
this.raw = this.version;
|
||||
return this;
|
||||
};
|
||||
exports2.inc = inc;
|
||||
function inc(version, release3, loose, identifier) {
|
||||
function inc(version, release2, loose, identifier) {
|
||||
if (typeof loose === "string") {
|
||||
identifier = loose;
|
||||
loose = void 0;
|
||||
}
|
||||
try {
|
||||
return new SemVer(version, loose).inc(release3, identifier).version;
|
||||
return new SemVer(version, loose).inc(release2, identifier).version;
|
||||
} catch (er) {
|
||||
return null;
|
||||
}
|
||||
@@ -54959,7 +54966,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`;
|
||||
}
|
||||
}
|
||||
};
|
||||
var access2 = {
|
||||
var access = {
|
||||
parameterPath: ["options", "access"],
|
||||
mapper: {
|
||||
serializedName: "x-ms-blob-public-access",
|
||||
@@ -56767,7 +56774,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`;
|
||||
requestId,
|
||||
accept1,
|
||||
metadata,
|
||||
access2,
|
||||
access,
|
||||
defaultEncryptionScope,
|
||||
preventEncryptionScopeOverride
|
||||
],
|
||||
@@ -56914,7 +56921,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`;
|
||||
accept,
|
||||
version,
|
||||
requestId,
|
||||
access2,
|
||||
access,
|
||||
leaseId,
|
||||
ifModifiedSince,
|
||||
ifUnmodifiedSince
|
||||
@@ -65760,7 +65767,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`;
|
||||
* @param containerAcl - Array of elements each having a unique Id and details of the access policy.
|
||||
* @param options - Options to Container Set Access Policy operation.
|
||||
*/
|
||||
async setAccessPolicy(access3, containerAcl2, options = {}) {
|
||||
async setAccessPolicy(access2, containerAcl2, options = {}) {
|
||||
options.conditions = options.conditions || {};
|
||||
return tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => {
|
||||
const acl = [];
|
||||
@@ -65776,7 +65783,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`;
|
||||
}
|
||||
return assertResponse(await this.containerContext.setAccessPolicy({
|
||||
abortSignal: options.abortSignal,
|
||||
access: access3,
|
||||
access: access2,
|
||||
containerAcl: acl,
|
||||
leaseAccessConditions: options.conditions,
|
||||
modifiedAccessConditions: options.conditions,
|
||||
@@ -76054,148 +76061,14 @@ var github = __toESM(require_github());
|
||||
var io2 = __toESM(require_io());
|
||||
|
||||
// src/util.ts
|
||||
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_io());
|
||||
|
||||
// node_modules/check-disk-space/dist/check-disk-space.mjs
|
||||
var import_node_child_process = require("node:child_process");
|
||||
var import_promises = require("node:fs/promises");
|
||||
var import_node_os = require("node:os");
|
||||
var import_node_path = require("node:path");
|
||||
var import_node_process = require("node:process");
|
||||
var import_node_util = require("node:util");
|
||||
var InvalidPathError = class _InvalidPathError extends Error {
|
||||
constructor(message) {
|
||||
super(message);
|
||||
this.name = "InvalidPathError";
|
||||
Object.setPrototypeOf(this, _InvalidPathError.prototype);
|
||||
}
|
||||
};
|
||||
var NoMatchError = class _NoMatchError extends Error {
|
||||
constructor(message) {
|
||||
super(message);
|
||||
this.name = "NoMatchError";
|
||||
Object.setPrototypeOf(this, _NoMatchError.prototype);
|
||||
}
|
||||
};
|
||||
async function isDirectoryExisting(directoryPath, dependencies) {
|
||||
try {
|
||||
await dependencies.fsAccess(directoryPath);
|
||||
return Promise.resolve(true);
|
||||
} catch (error4) {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
}
|
||||
async function getFirstExistingParentPath(directoryPath, dependencies) {
|
||||
let parentDirectoryPath = directoryPath;
|
||||
let parentDirectoryFound = await isDirectoryExisting(parentDirectoryPath, dependencies);
|
||||
while (!parentDirectoryFound) {
|
||||
parentDirectoryPath = dependencies.pathNormalize(parentDirectoryPath + "/..");
|
||||
parentDirectoryFound = await isDirectoryExisting(parentDirectoryPath, dependencies);
|
||||
}
|
||||
return parentDirectoryPath;
|
||||
}
|
||||
async function hasPowerShell3(dependencies) {
|
||||
const major = parseInt(dependencies.release.split(".")[0], 10);
|
||||
if (major <= 6) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
await dependencies.cpExecFile("where", ["powershell"], { windowsHide: true });
|
||||
return true;
|
||||
} catch (error4) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function checkDiskSpace(directoryPath, dependencies = {
|
||||
platform: import_node_process.platform,
|
||||
release: (0, import_node_os.release)(),
|
||||
fsAccess: import_promises.access,
|
||||
pathNormalize: import_node_path.normalize,
|
||||
pathSep: import_node_path.sep,
|
||||
cpExecFile: (0, import_node_util.promisify)(import_node_child_process.execFile)
|
||||
}) {
|
||||
function mapOutput(stdout, filter, mapping, coefficient) {
|
||||
const parsed = stdout.split("\n").map((line) => line.trim()).filter((line) => line.length !== 0).slice(1).map((line) => line.split(/\s+(?=[\d/])/));
|
||||
const filtered = parsed.filter(filter);
|
||||
if (filtered.length === 0) {
|
||||
throw new NoMatchError();
|
||||
}
|
||||
const diskData = filtered[0];
|
||||
return {
|
||||
diskPath: diskData[mapping.diskPath],
|
||||
free: parseInt(diskData[mapping.free], 10) * coefficient,
|
||||
size: parseInt(diskData[mapping.size], 10) * coefficient
|
||||
};
|
||||
}
|
||||
async function check(cmd, filter, mapping, coefficient = 1) {
|
||||
const [file, ...args] = cmd;
|
||||
if (file === void 0) {
|
||||
return Promise.reject(new Error("cmd must contain at least one item"));
|
||||
}
|
||||
try {
|
||||
const { stdout } = await dependencies.cpExecFile(file, args, { windowsHide: true });
|
||||
return mapOutput(stdout, filter, mapping, coefficient);
|
||||
} catch (error4) {
|
||||
return Promise.reject(error4);
|
||||
}
|
||||
}
|
||||
async function checkWin32(directoryPath2) {
|
||||
if (directoryPath2.charAt(1) !== ":") {
|
||||
return Promise.reject(new InvalidPathError(`The following path is invalid (should be X:\\...): ${directoryPath2}`));
|
||||
}
|
||||
const powershellCmd = [
|
||||
"powershell",
|
||||
"Get-CimInstance -ClassName Win32_LogicalDisk | Select-Object Caption, FreeSpace, Size"
|
||||
];
|
||||
const wmicCmd = [
|
||||
"wmic",
|
||||
"logicaldisk",
|
||||
"get",
|
||||
"size,freespace,caption"
|
||||
];
|
||||
const cmd = await hasPowerShell3(dependencies) ? powershellCmd : wmicCmd;
|
||||
return check(cmd, (driveData) => {
|
||||
const driveLetter = driveData[0];
|
||||
return directoryPath2.toUpperCase().startsWith(driveLetter.toUpperCase());
|
||||
}, {
|
||||
diskPath: 0,
|
||||
free: 1,
|
||||
size: 2
|
||||
});
|
||||
}
|
||||
async function checkUnix(directoryPath2) {
|
||||
if (!dependencies.pathNormalize(directoryPath2).startsWith(dependencies.pathSep)) {
|
||||
return Promise.reject(new InvalidPathError(`The following path is invalid (should start by ${dependencies.pathSep}): ${directoryPath2}`));
|
||||
}
|
||||
const pathToCheck = await getFirstExistingParentPath(directoryPath2, dependencies);
|
||||
return check(
|
||||
[
|
||||
"df",
|
||||
"-Pk",
|
||||
"--",
|
||||
pathToCheck
|
||||
],
|
||||
() => true,
|
||||
// We should only get one line, so we did not need to filter
|
||||
{
|
||||
diskPath: 5,
|
||||
free: 3,
|
||||
size: 1
|
||||
},
|
||||
1024
|
||||
);
|
||||
}
|
||||
if (dependencies.platform === "win32") {
|
||||
return checkWin32(directoryPath);
|
||||
}
|
||||
return checkUnix(directoryPath);
|
||||
}
|
||||
|
||||
// node_modules/get-folder-size/index.js
|
||||
var import_node_path2 = require("node:path");
|
||||
var import_node_path = require("node:path");
|
||||
async function getFolderSize(itemPath, options) {
|
||||
return await core(itemPath, options, { errors: true });
|
||||
}
|
||||
@@ -76220,7 +76093,7 @@ async function core(rootItemPath, options = {}, returnType = {}) {
|
||||
if (typeof directoryItems !== "object") return;
|
||||
await Promise.all(
|
||||
directoryItems.map(
|
||||
(directoryItem) => processItem((0, import_node_path2.join)(itemPath, directoryItem))
|
||||
(directoryItem) => processItem((0, import_node_path.join)(itemPath, directoryItem))
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -79001,16 +78874,14 @@ function getErrorMessage(error4) {
|
||||
}
|
||||
async function checkDiskUsage(logger) {
|
||||
try {
|
||||
if (process.platform === "darwin" && (process.arch === "arm" || process.arch === "arm64") && !await checkSipEnablement(logger)) {
|
||||
return void 0;
|
||||
}
|
||||
const diskUsage = await checkDiskSpace(
|
||||
const diskUsage = await fsPromises.statfs(
|
||||
getRequiredEnvParam("GITHUB_WORKSPACE")
|
||||
);
|
||||
const mbInBytes = 1024 * 1024;
|
||||
const gbInBytes = 1024 * 1024 * 1024;
|
||||
if (diskUsage.free < 2 * gbInBytes) {
|
||||
const message = `The Actions runner is running low on disk space (${(diskUsage.free / mbInBytes).toPrecision(4)} MB available).`;
|
||||
const blockSizeInBytes = diskUsage.bsize;
|
||||
const numBlocksPerMb = 1024 * 1024 / blockSizeInBytes;
|
||||
const numBlocksPerGb = 1024 * 1024 * 1024 / blockSizeInBytes;
|
||||
if (diskUsage.bavail < 2 * numBlocksPerGb) {
|
||||
const message = `The Actions runner is running low on disk space (${(diskUsage.bavail / numBlocksPerMb).toPrecision(4)} MB available).`;
|
||||
if (process.env["CODEQL_ACTION_HAS_WARNED_ABOUT_DISK_SPACE" /* HAS_WARNED_ABOUT_DISK_SPACE */] !== "true") {
|
||||
logger.warning(message);
|
||||
} else {
|
||||
@@ -79019,8 +78890,8 @@ async function checkDiskUsage(logger) {
|
||||
core3.exportVariable("CODEQL_ACTION_HAS_WARNED_ABOUT_DISK_SPACE" /* HAS_WARNED_ABOUT_DISK_SPACE */, "true");
|
||||
}
|
||||
return {
|
||||
numAvailableBytes: diskUsage.free,
|
||||
numTotalBytes: diskUsage.size
|
||||
numAvailableBytes: diskUsage.bavail * blockSizeInBytes,
|
||||
numTotalBytes: diskUsage.blocks * blockSizeInBytes
|
||||
};
|
||||
} catch (error4) {
|
||||
logger.warning(
|
||||
@@ -79046,34 +78917,6 @@ function checkActionVersion(version, githubVersion) {
|
||||
function cloneObject(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
async function checkSipEnablement(logger) {
|
||||
if (process.env["CODEQL_ACTION_IS_SIP_ENABLED" /* IS_SIP_ENABLED */] !== void 0 && ["true", "false"].includes(process.env["CODEQL_ACTION_IS_SIP_ENABLED" /* IS_SIP_ENABLED */])) {
|
||||
return process.env["CODEQL_ACTION_IS_SIP_ENABLED" /* 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."
|
||||
)) {
|
||||
core3.exportVariable("CODEQL_ACTION_IS_SIP_ENABLED" /* IS_SIP_ENABLED */, "true");
|
||||
return true;
|
||||
}
|
||||
if (sipStatusOutput.stdout.includes(
|
||||
"System Integrity Protection status: disabled."
|
||||
)) {
|
||||
core3.exportVariable("CODEQL_ACTION_IS_SIP_ENABLED" /* IS_SIP_ENABLED */, "false");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
} catch (e) {
|
||||
logger.warning(
|
||||
`Failed to determine if System Integrity Protection was enabled: ${e}`
|
||||
);
|
||||
return void 0;
|
||||
}
|
||||
}
|
||||
async function asyncSome(array, predicate) {
|
||||
const results = await Promise.all(array.map(predicate));
|
||||
return results.some((result) => result);
|
||||
@@ -79532,7 +79375,7 @@ function getCliConfigCategoryIfExists(cliError) {
|
||||
}
|
||||
function isUnsupportedPlatform() {
|
||||
return !SUPPORTED_PLATFORMS.some(
|
||||
([platform2, arch]) => platform2 === process.platform && arch === process.arch
|
||||
([platform, arch]) => platform === process.platform && arch === process.arch
|
||||
);
|
||||
}
|
||||
function getUnsupportedPlatformError(cliError) {
|
||||
|
||||
Reference in New Issue
Block a user