diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 8e50fb9de..daec727ce 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -89746,9 +89746,6 @@ function getErrorMessage(error2) { } async function checkDiskUsage(logger) { try { - if (process.platform === "darwin" && (process.arch === "arm" || process.arch === "arm64") && !await checkSipEnablement(logger)) { - return void 0; - } const diskUsage = await fsPromises4.statfs( getRequiredEnvParam("GITHUB_WORKSPACE") ); @@ -89800,34 +89797,6 @@ function satisfiesGHESVersion(ghesVersion, range, defaultIfInvalid) { 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 cleanUpGlob(glob2, name, logger) { logger.debug(`Cleaning up ${name}.`); try { diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 034e649bb..cd7387410 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -78904,9 +78904,6 @@ function getErrorMessage(error2) { } async function checkDiskUsage(logger) { try { - if (process.platform === "darwin" && (process.arch === "arm" || process.arch === "arm64") && !await checkSipEnablement(logger)) { - return void 0; - } const diskUsage = await fsPromises.statfs( getRequiredEnvParam("GITHUB_WORKSPACE") ); @@ -78950,34 +78947,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 asyncFilter(array, predicate) { const results = await Promise.all(array.map(predicate)); return array.filter((_, index) => results[index]); diff --git a/lib/init-action-post.js b/lib/init-action-post.js index 8a08c988e..f8411cd43 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -128022,9 +128022,6 @@ function getErrorMessage(error2) { } async function checkDiskUsage(logger) { try { - if (process.platform === "darwin" && (process.arch === "arm" || process.arch === "arm64") && !await checkSipEnablement(logger)) { - return void 0; - } const diskUsage = await fsPromises4.statfs( getRequiredEnvParam("GITHUB_WORKSPACE") ); @@ -128062,34 +128059,6 @@ function satisfiesGHESVersion(ghesVersion, range, defaultIfInvalid) { 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 cleanUpGlob(glob2, name, logger) { logger.debug(`Cleaning up ${name}.`); try { diff --git a/lib/init-action.js b/lib/init-action.js index 41e3572b1..5cd71c4e5 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -87061,9 +87061,6 @@ function prettyPrintPack(pack) { } async function checkDiskUsage(logger) { try { - if (process.platform === "darwin" && (process.arch === "arm" || process.arch === "arm64") && !await checkSipEnablement(logger)) { - return void 0; - } const diskUsage = await fsPromises4.statfs( getRequiredEnvParam("GITHUB_WORKSPACE") ); @@ -87121,34 +87118,6 @@ var BuildMode = /* @__PURE__ */ ((BuildMode3) => { 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 cleanUpGlob(glob2, name, logger) { logger.debug(`Cleaning up ${name}.`); try { diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index 458108461..1449a356a 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -78916,9 +78916,6 @@ function getErrorMessage(error2) { } async function checkDiskUsage(logger) { try { - if (process.platform === "darwin" && (process.arch === "arm" || process.arch === "arm64") && !await checkSipEnablement(logger)) { - return void 0; - } const diskUsage = await fsPromises.statfs( getRequiredEnvParam("GITHUB_WORKSPACE") ); @@ -78962,34 +78959,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); diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index 826bf126f..96a7f6217 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -85571,9 +85571,6 @@ function getErrorMessage(error2) { } async function checkDiskUsage(logger) { try { - if (process.platform === "darwin" && (process.arch === "arm" || process.arch === "arm64") && !await checkSipEnablement(logger)) { - return void 0; - } const diskUsage = await fsPromises4.statfs( getRequiredEnvParam("GITHUB_WORKSPACE") ); @@ -85617,34 +85614,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 cleanUpGlob(glob, name, logger) { logger.debug(`Cleaning up ${name}.`); try { diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index 8ab528908..647c153df 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -96010,9 +96010,6 @@ function getErrorMessage(error2) { } async function checkDiskUsage(logger) { try { - if (process.platform === "darwin" && (process.arch === "arm" || process.arch === "arm64") && !await checkSipEnablement(logger)) { - return void 0; - } const diskUsage = await fsPromises.statfs( getRequiredEnvParam("GITHUB_WORKSPACE") ); @@ -96039,34 +96036,6 @@ async function checkDiskUsage(logger) { return void 0; } } -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; - } -} function isDefined(value) { return value !== void 0 && value !== null; } diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 72725fbd1..8c16fce58 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -88391,9 +88391,6 @@ function getErrorMessage(error2) { } async function checkDiskUsage(logger) { try { - if (process.platform === "darwin" && (process.arch === "arm" || process.arch === "arm64") && !await checkSipEnablement(logger)) { - return void 0; - } const diskUsage = await fsPromises4.statfs( getRequiredEnvParam("GITHUB_WORKSPACE") ); @@ -88445,34 +88442,6 @@ function satisfiesGHESVersion(ghesVersion, range, defaultIfInvalid) { 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 cleanUpGlob(glob, name, logger) { logger.debug(`Cleaning up ${name}.`); try { diff --git a/src/util.ts b/src/util.ts index 623edc8fc..037938957 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1099,15 +1099,6 @@ export async function checkDiskUsage( logger: Logger, ): Promise { try { - // We avoid running the `df` binary under the hood for macOS ARM runners with SIP disabled. - if ( - process.platform === "darwin" && - (process.arch === "arm" || process.arch === "arm64") && - !(await checkSipEnablement(logger)) - ) { - return undefined; - } - const diskUsage = await fsPromises.statfs( getRequiredEnvParam("GITHUB_WORKSPACE"), );