Update setup.ts

This commit is contained in:
arjundashrath 2022-02-09 00:19:16 +05:30 committed by GitHub
commit 5ae06b95cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"];