mirror of
https://github.com/github/codeql-action.git
synced 2026-01-03 21:20:09 +08:00
Stop checking disk usage for MacOS ARM with SIP disabled (#2434)
* Stop checking disk usage for MacOS ARM with SIP disabled On MacOS ARM machines where SIP is disabled, after the build tracer is initialized in the `init` Action, we receive warnings when we run send status reports due to the `df` binary. This change will make it so that we no longer run `df` for those machines.
This commit is contained in:
33
src/init.ts
33
src/init.ts
@@ -1,7 +1,6 @@
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
|
||||
import * as exec from "@actions/exec/lib/exec";
|
||||
import * as toolrunner from "@actions/exec/lib/toolrunner";
|
||||
import * as safeWhich from "@chrisgavin/safe-which";
|
||||
|
||||
@@ -141,38 +140,6 @@ export async function checkInstallPython311(
|
||||
}
|
||||
}
|
||||
|
||||
// For MacOS runners: runs `csrutil status` to determine whether System
|
||||
// Integrity Protection is enabled.
|
||||
export async function isSipEnabled(
|
||||
logger: Logger,
|
||||
): Promise<boolean | undefined> {
|
||||
try {
|
||||
const sipStatusOutput = await exec.getExecOutput("csrutil status");
|
||||
if (sipStatusOutput.exitCode === 0) {
|
||||
if (
|
||||
sipStatusOutput.stdout.includes(
|
||||
"System Integrity Protection status: enabled.",
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
sipStatusOutput.stdout.includes(
|
||||
"System Integrity Protection status: disabled.",
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
} catch (e) {
|
||||
logger.warning(
|
||||
`Failed to determine if System Integrity Protection was enabled: ${e}`,
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export function cleanupDatabaseClusterDirectory(
|
||||
config: configUtils.Config,
|
||||
logger: Logger,
|
||||
|
||||
Reference in New Issue
Block a user