feat: skip agent install and post step on subsequent runs for GitHub-hosted runners
This commit is contained in:
parent
e152b90204
commit
c51e8eeb6c
7 changed files with 21 additions and 2 deletions
|
|
@ -32,6 +32,7 @@ inputs:
|
|||
description: "Policy name to be used from the policy store"
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
branding:
|
||||
icon: "check-square"
|
||||
color: "green"
|
||||
|
|
|
|||
4
dist/post/index.js
vendored
4
dist/post/index.js
vendored
|
|
@ -32166,6 +32166,10 @@ var cleanup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _
|
|||
console.log(HARDEN_RUNNER_UNAVAILABLE_MESSAGE);
|
||||
return;
|
||||
}
|
||||
if (isGithubHosted() && external_fs_.existsSync("/home/agent/post_event.json")) {
|
||||
console.log("Post step already executed, skipping");
|
||||
return;
|
||||
}
|
||||
external_fs_.writeFileSync("/home/agent/post_event.json", JSON.stringify({ event: "post" }));
|
||||
const doneFile = "/home/agent/done.json";
|
||||
let counter = 0;
|
||||
|
|
|
|||
2
dist/post/index.js.map
vendored
2
dist/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/pre/index.js
vendored
4
dist/pre/index.js
vendored
|
|
@ -85780,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 };
|
||||
|
|
|
|||
2
dist/pre/index.js.map
vendored
2
dist/pre/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -48,6 +48,11 @@ import { context } from "@actions/github";
|
|||
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" })
|
||||
|
|
|
|||
|
|
@ -263,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 };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue