diff --git a/src/cleanup.ts b/src/cleanup.ts index 5a1c450..8d8e531 100644 --- a/src/cleanup.ts +++ b/src/cleanup.ts @@ -26,6 +26,11 @@ import { isPlatformSupported, isAgentInstalled } from "./utils"; return; } + if (isGithubHosted() && process.platform === "linux" && !process.env.USER) { + console.log(common.UBUNTU_SLIM_MESSAGE); + return; + } + if (isARCRunner()) { console.log(`[!] ${common.ARC_RUNNER_MESSAGE}`); return; diff --git a/src/common.ts b/src/common.ts index 81f36bf..0409778 100644 --- a/src/common.ts +++ b/src/common.ts @@ -148,3 +148,6 @@ export const ARM64_RUNNER_MESSAGE = export const ARM64_WINDOWS_RUNNER_MESSAGE = "Windows ARM runners are not yet supported by Harden-Runner."; + +export const UBUNTU_SLIM_MESSAGE = + "This job is running on an ubuntu-slim runner (GitHub-hosted Linux container without a standard USER environment variable). Harden Runner is not supported on ubuntu-slim runners. This job will not be monitored."; diff --git a/src/setup.ts b/src/setup.ts index bd45f33..b22fc75 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -64,6 +64,11 @@ interface MonitorResponse { return; } + if (isGithubHosted() && process.platform === "linux" && !process.env.USER) { + console.log(common.UBUNTU_SLIM_MESSAGE); + return; + } + var correlation_id = uuidv4(); var api_url = STEPSECURITY_API_URL; var web_url = STEPSECURITY_WEB_URL;