Skip to content

Commit

Permalink
platform configurable and critical handling
Browse files Browse the repository at this point in the history
  • Loading branch information
notshivansh committed Jan 30, 2025
1 parent 4fcf222 commit 513b4dd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,19 @@ async function waitTillComplete(testDetails, maxWaitTime) {

if (state === 'COMPLETED') {
const { countIssues } = response.testingRunResultSummaries[0];
const { CRITICAL, HIGH, MEDIUM, LOW } = countIssues;
let { CRITICAL, HIGH, MEDIUM, LOW } = countIssues;

if (!CRITICAL) {
CRITICAL = 0
}

logGithubStepSummary(`[Results](${AKTO_DASHBOARD_URL}/dashboard/testing/${AKTO_TEST_ID}/results)`);
logGithubStepSummary(`CRITICAL: ${CRITICAL}`);
logGithubStepSummary(`HIGH: ${HIGH}`);
logGithubStepSummary(`MEDIUM: ${MEDIUM}`);
logGithubStepSummary(`LOW: ${LOW}`);

if (CRITICAL> 0 || HIGH > 0 || MEDIUM > 0 || LOW > 0) {
if (CRITICAL > 0 || HIGH > 0 || MEDIUM > 0 || LOW > 0) {
logGithubStepSummary(`Vulnerabilities found!!`);

let blockLevel = parseBlockLevel(BLOCK_LEVEL)
Expand Down Expand Up @@ -131,7 +135,7 @@ async function run() {
"testingRunHexId": AKTO_TEST_ID,
"startTimestamp" : startTimestamp,
"metadata": {
"platform": "Github Actions",
"platform": process.env.CICD_PLATFORM || "Github Actions",
"repository": process.env.GITHUB_REPOSITORY,
"repository_url": process.env.GITHUB_SERVER_URL + "/" + process.env.GITHUB_REPOSITORY,
"branch": process.env.GITHUB_REF_NAME,
Expand Down

0 comments on commit 513b4dd

Please sign in to comment.