1
0
Fork 0
mirror of synced 2026-06-05 17:34:04 +00:00

Check for is-docker

This commit is contained in:
Varun Sharma 2022-04-21 21:03:17 -07:00
commit 9a1f78a5a0
5 changed files with 288 additions and 281 deletions

546
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -28,6 +28,7 @@
"@actions/http-client": "^1.0.11",
"@actions/tool-cache": "^1.7.1",
"ansi-regex": ">=5.0.1",
"is-docker": "^3.0.0",
"node-fetch": ">=3.2.0",
"uuid": "^8.3.2"
},

View file

@ -1,12 +1,19 @@
import * as fs from "fs";
import * as cp from "child_process";
import * as core from "@actions/core";
import isDocker from "is-docker";
(async () => {
if (process.platform !== "linux") {
console.log("Only runs on linux");
return;
}
if (isDocker()) {
console.log(
"StepSecurity Harden Runner does not run inside a Docker container"
);
return;
}
fs.writeFileSync(
"/home/agent/post_event.json",

View file

@ -1,11 +1,18 @@
import { printInfo } from "./common";
import * as core from "@actions/core";
import isDocker from "is-docker";
(async () => {
if (process.platform !== "linux") {
console.log("Only runs on linux");
return;
}
if (isDocker()) {
console.log(
"StepSecurity Harden Runner does not run inside a Docker container"
);
return;
}
if (
core.getBooleanInput("disable-telemetry") &&

View file

@ -7,12 +7,20 @@ import { v4 as uuidv4 } from "uuid";
import { printInfo } from "./common";
import * as tc from "@actions/tool-cache";
import { verifyChecksum } from "./checksum";
import isDocker from "is-docker";
(async () => {
try {
if (process.platform !== "linux") {
console.log("Only runs on linux");
return;
}
if (isDocker()) {
console.log(
"StepSecurity Harden Runner does not run inside a Docker container"
);
return;
}
var correlation_id = uuidv4();
var env = "agent";