Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,400 changes: 4,344 additions & 56 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4,404 changes: 4,348 additions & 56 deletions dist/post/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/post/index.js.map

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions dist/pre/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85609,9 +85609,14 @@ var setup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _ar


(() => setup_awaiter(void 0, void 0, void 0, function* () {
var _a, _b;
var _a, _b, _c, _d;
try {
console.log("[harden-runner] pre-step");
const customProperties = ((_b = (_a = github.context === null || github.context === void 0 ? void 0 : github.context.payload) === null || _a === void 0 ? void 0 : _a.repository) === null || _b === void 0 ? void 0 : _b.custom_properties) || {};
if (customProperties["skip-harden-runner"] === "true") {
console.log("Skipping harden-runner: custom property 'skip-harden-runner' is set to 'true'");
return;
}
if (process.platform !== "linux") {
console.log(UBUNTU_MESSAGE);
return;
Expand All @@ -85635,7 +85640,7 @@ var setup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _ar
disable_sudo: lib_core.getBooleanInput("disable-sudo"),
disable_sudo_and_containers: lib_core.getBooleanInput("disable-sudo-and-containers"),
disable_file_monitoring: lib_core.getBooleanInput("disable-file-monitoring"),
private: ((_b = (_a = github.context === null || github.context === void 0 ? void 0 : github.context.payload) === null || _a === void 0 ? void 0 : _a.repository) === null || _b === void 0 ? void 0 : _b.private) || false,
private: ((_d = (_c = github.context === null || github.context === void 0 ? void 0 : github.context.payload) === null || _c === void 0 ? void 0 : _c.repository) === null || _d === void 0 ? void 0 : _d.private) || false,
is_github_hosted: isGithubHosted(),
is_debug: lib_core.isDebug(),
one_time_key: "",
Expand Down Expand Up @@ -85775,6 +85780,10 @@ var setup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _ar
}
return;
}
if (isGithubHosted() && external_fs_.existsSync("/home/agent/agent.status")) {
console.log("Agent already installed, skipping installation");
return;
}
let _http = new lib.HttpClient();
let statusCode;
_http.requestOptions = { socketTimeout: 3 * 1000 };
Expand Down
2 changes: 1 addition & 1 deletion dist/pre/index.js.map

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions src/cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ import * as common from "./common";
import isDocker from "is-docker";
import { isARCRunner } from "./arc-runner";
import { isGithubHosted } from "./tls-inspect";
import { context } from "@actions/github";
(async () => {
console.log("[harden-runner] post-step");

const customProperties = context?.payload?.repository?.custom_properties || {};
if (customProperties["skip-harden-runner"] === "true") {
console.log("Skipping harden-runner: custom property 'skip-harden-runner' is set to 'true'");
return;
}

if (process.platform !== "linux") {
console.log(common.UBUNTU_MESSAGE);
return;
Expand Down Expand Up @@ -41,6 +48,11 @@ import { isGithubHosted } from "./tls-inspect";
return;
}

if (isGithubHosted() && fs.existsSync("/home/agent/post_event.json")) {
console.log("Post step already executed, skipping");
return;
}

fs.writeFileSync(
"/home/agent/post_event.json",
JSON.stringify({ event: "post" })
Expand Down
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ import * as core from "@actions/core";
import isDocker from "is-docker";
import { STEPSECURITY_WEB_URL } from "./configs";
import { isGithubHosted } from "./tls-inspect";
import { context } from "@actions/github";
(async () => {
console.log("[harden-runner] main-step");

const customProperties = context?.payload?.repository?.custom_properties || {};
if (customProperties["skip-harden-runner"] === "true") {
console.log("Skipping harden-runner: custom property 'skip-harden-runner' is set to 'true'");
return;
}

if (process.platform !== "linux") {
console.log(common.UBUNTU_MESSAGE);
return;
Expand Down
11 changes: 11 additions & 0 deletions src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ interface MonitorResponse {
try {
console.log("[harden-runner] pre-step");

const customProperties = context?.payload?.repository?.custom_properties || {};
if (customProperties["skip-harden-runner"] === "true") {
console.log("Skipping harden-runner: custom property 'skip-harden-runner' is set to 'true'");
return;
}

if (process.platform !== "linux") {
console.log(common.UBUNTU_MESSAGE);
return;
Expand Down Expand Up @@ -257,6 +263,11 @@ interface MonitorResponse {
return;
}

if (isGithubHosted() && fs.existsSync("/home/agent/agent.status")) {
console.log("Agent already installed, skipping installation");
return;
}

let _http = new httpm.HttpClient();
let statusCode: number | undefined;
_http.requestOptions = { socketTimeout: 3 * 1000 };
Expand Down
Loading