From 964048e897250b745b1b2223136bb34e25f471d0 Mon Sep 17 00:00:00 2001 From: UncleVic Date: Thu, 30 Sep 2021 11:25:18 +0300 Subject: [PATCH] fix: rescan will set id in the output --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 3b74743..69b05f9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -49,9 +49,10 @@ async function retest(token: string, uuid: string, scanName?: string) { options ); - if (restRes.statusCode < 300) { - const url = `${baseUrl}/scans/${restRes.result?.id}`; + if (restRes.statusCode < 300 && restRes.result) { + const url = `${baseUrl}/scans/${restRes.result.id}`; core.setOutput('url', url); + core.setOutput('id', restRes.result.id); } else { core.setFailed(`Failed retest. Status code: ${restRes.statusCode}`); }