mirror of
https://github.com/step-security/harden-runner.git
synced 2026-06-06 01:47:05 +00:00
Update setup.ts
This commit is contained in:
parent
86165a4921
commit
5ae06b95cd
1 changed files with 9 additions and 1 deletions
10
src/setup.ts
10
src/setup.ts
|
|
@ -39,6 +39,7 @@ import {verifyChecksum} from "./checksum"
|
|||
api_url: api_url,
|
||||
allowed_endpoints: core.getInput("allowed-endpoints"),
|
||||
egress_policy: core.getInput("egress-policy"),
|
||||
send_insights: core.getInput("send-insights"),
|
||||
};
|
||||
|
||||
if (confg.egress_policy !== "audit" && confg.egress_policy !== "block") {
|
||||
|
|
@ -51,6 +52,10 @@ import {verifyChecksum} from "./checksum"
|
|||
);
|
||||
}
|
||||
|
||||
if (confg.send_insights !== 'true' && confg.send_insights !== 'false') {
|
||||
core.setFailed("send-insights must be either true or false");
|
||||
}
|
||||
|
||||
const confgStr = JSON.stringify(confg);
|
||||
cp.execSync("sudo mkdir -p /home/agent");
|
||||
cp.execSync("sudo chown -R $USER /home/agent");
|
||||
|
|
@ -64,7 +69,10 @@ import {verifyChecksum} from "./checksum"
|
|||
const extractPath = await tc.extractTar(downloadPath);
|
||||
|
||||
console.log(`Step Security Job Correlation ID: ${correlation_id}`);
|
||||
printInfo(web_url);
|
||||
|
||||
if (confg.send_insights === 'true'){
|
||||
printInfo(web_url);
|
||||
}
|
||||
|
||||
let cmd = "cp",
|
||||
args = [path.join(extractPath, "agent"), "/home/agent/agent"];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue