Skip to content

Commit a5ad31d

Browse files
Merge pull request #657 from devantler/fix/ubuntu-slim-user-env
fix: detect ubuntu-slim runners early and bail out
2 parents 8d3c67d + 6e92856 commit a5ad31d

9 files changed

Lines changed: 27 additions & 3 deletions

File tree

dist/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32046,6 +32046,7 @@ const HARDEN_RUNNER_UNAVAILABLE_MESSAGE = "Sorry, we are currently experiencing
3204632046
const ARC_RUNNER_MESSAGE = "Workflow is currently being executed in ARC based runner.";
3204732047
const ARM64_RUNNER_MESSAGE = "ARM runners are not supported in the Harden-Runner community tier.";
3204832048
const ARM64_WINDOWS_RUNNER_MESSAGE = "Windows ARM runners are not yet supported by Harden-Runner.";
32049+
const UBUNTU_SLIM_MESSAGE = "This job is running on an ubuntu-slim runner. Harden Runner is not supported on ubuntu-slim runners. This job will not be monitored.";
3204932050

3205032051
;// CONCATENATED MODULE: external "node:fs"
3205132052
const external_node_fs_namespaceObject = require("node:fs");

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/post/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32052,6 +32052,7 @@ const HARDEN_RUNNER_UNAVAILABLE_MESSAGE = "Sorry, we are currently experiencing
3205232052
const ARC_RUNNER_MESSAGE = "Workflow is currently being executed in ARC based runner.";
3205332053
const ARM64_RUNNER_MESSAGE = "ARM runners are not supported in the Harden-Runner community tier.";
3205432054
const ARM64_WINDOWS_RUNNER_MESSAGE = "Windows ARM runners are not yet supported by Harden-Runner.";
32055+
const UBUNTU_SLIM_MESSAGE = "This job is running on an ubuntu-slim runner. Harden Runner is not supported on ubuntu-slim runners. This job will not be monitored.";
3205532056

3205632057
// EXTERNAL MODULE: external "path"
3205732058
var external_path_ = __nccwpck_require__(6928);
@@ -32214,6 +32215,10 @@ var cleanup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _
3221432215
console.log(CONTAINER_MESSAGE);
3221532216
return;
3221632217
}
32218+
if (isGithubHosted() && process.platform === "linux" && !process.env.USER) {
32219+
console.log(UBUNTU_SLIM_MESSAGE);
32220+
return;
32221+
}
3221732222
if (isARCRunner()) {
3221832223
console.log(`[!] ${ARC_RUNNER_MESSAGE}`);
3221932224
return;

dist/post/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/pre/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85171,6 +85171,7 @@ const HARDEN_RUNNER_UNAVAILABLE_MESSAGE = "Sorry, we are currently experiencing
8517185171
const ARC_RUNNER_MESSAGE = "Workflow is currently being executed in ARC based runner.";
8517285172
const ARM64_RUNNER_MESSAGE = "ARM runners are not supported in the Harden-Runner community tier.";
8517385173
const ARM64_WINDOWS_RUNNER_MESSAGE = "Windows ARM runners are not yet supported by Harden-Runner.";
85174+
const UBUNTU_SLIM_MESSAGE = "This job is running on an ubuntu-slim runner. Harden Runner is not supported on ubuntu-slim runners. This job will not be monitored.";
8517485175

8517585176
;// CONCATENATED MODULE: external "node:fs"
8517685177
const external_node_fs_namespaceObject = require("node:fs");
@@ -85812,6 +85813,10 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
8581285813
console.log(CONTAINER_MESSAGE);
8581385814
return;
8581485815
}
85816+
if (isGithubHosted() && process.platform === "linux" && !process.env.USER) {
85817+
console.log(UBUNTU_SLIM_MESSAGE);
85818+
return;
85819+
}
8581585820
var correlation_id = v4();
8581685821
var api_url = configs_STEPSECURITY_API_URL;
8581785822
var web_url = STEPSECURITY_WEB_URL;

dist/pre/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cleanup.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ import { isPlatformSupported, isAgentInstalled, detectThirdPartyRunnerProvider }
2626
return;
2727
}
2828

29+
if (isGithubHosted() && process.platform === "linux" && !process.env.USER) {
30+
console.log(common.UBUNTU_SLIM_MESSAGE);
31+
return;
32+
}
33+
2934
if (isARCRunner()) {
3035
console.log(`[!] ${common.ARC_RUNNER_MESSAGE}`);
3136
return;

src/common.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,6 @@ export const ARM64_RUNNER_MESSAGE =
148148

149149
export const ARM64_WINDOWS_RUNNER_MESSAGE =
150150
"Windows ARM runners are not yet supported by Harden-Runner.";
151+
152+
export const UBUNTU_SLIM_MESSAGE =
153+
"This job is running on an ubuntu-slim runner. Harden Runner is not supported on ubuntu-slim runners. This job will not be monitored.";

src/setup.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ interface MonitorResponse {
6666
return;
6767
}
6868

69+
if (isGithubHosted() && process.platform === "linux" && !process.env.USER) {
70+
console.log(common.UBUNTU_SLIM_MESSAGE);
71+
return;
72+
}
73+
6974
var correlation_id = uuidv4();
7075
var api_url = STEPSECURITY_API_URL;
7176
var web_url = STEPSECURITY_WEB_URL;

0 commit comments

Comments
 (0)