From 81462a2640a1f469fd8998ec2c1660d92452f1a9 Mon Sep 17 00:00:00 2001 From: arjundashrath <54043589+arjundashrath@users.noreply.github.com> Date: Thu, 10 Feb 2022 21:28:10 +0530 Subject: [PATCH] Add files via upload --- src/index.ts | 8 ++++---- src/setup.ts | 13 +++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index dbfbd08..21c1541 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,11 +7,11 @@ import * as core from "@actions/core"; return; } - if (core.getInput("send-insights") === 'true'){ + if (core.getBooleanInput("disable-telemetry") === true && core.getInput("egress-policy") === "block"){ + core.warning("Insights will not be sent to StepSecurity API as disable-telemetry is set to true"); + } + else{ var web_url = "https://app.stepsecurity.io"; printInfo(web_url); } - else{ - core.warning("Insights will not be sent to StepSecurity API as send-insights is set to false"); - } })(); diff --git a/src/setup.ts b/src/setup.ts index 66c69bd..8ff256c 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -39,7 +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"), + disable_telemetry: core.getBooleanInput("disable-telemetry"), }; if (confg.egress_policy !== "audit" && confg.egress_policy !== "block") { @@ -52,8 +52,8 @@ import {verifyChecksum} from "./checksum" ); } - if (confg.send_insights !== 'true' && confg.send_insights !== 'false') { - core.setFailed("send-insights must be either true or false"); + if (confg.disable_telemetry !== true && confg.disable_telemetry !== false) { + core.setFailed("disable-telemetry must be a boolean value"); } const confgStr = JSON.stringify(confg); @@ -70,9 +70,14 @@ import {verifyChecksum} from "./checksum" console.log(`Step Security Job Correlation ID: ${correlation_id}`); - if (confg.send_insights === 'true'){ + if (confg.disable_telemetry === false){ printInfo(web_url); } + else{ + if(confg.egress_policy === "audit"){ + printInfo(web_url); + } + } let cmd = "cp", args = [path.join(extractPath, "agent"), "/home/agent/agent"];