From 9f14791a751cc9d0d02e1922b8fe24a29352aa7f Mon Sep 17 00:00:00 2001 From: CI Date: Sat, 4 May 2024 16:06:18 +0000 Subject: [PATCH] ci:Action compiled by ncc [skip ci] --- dist/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 4022585..45c49bb 100644 --- a/dist/index.js +++ b/dist/index.js @@ -78964,12 +78964,16 @@ function createArrayFrom(tags) { }); } +function withoutEmptyProperties(obj) { + return Object.fromEntries(Object.entries(obj).filter(([_, v]) => v !== "")); +} + const createAlertRequestFrom = (alertDetails) => { const request = {}; Object.assign(request, alertDetails, { tags: createArrayFrom(alertDetails.tags), }); - return request; + return withoutEmptyProperties(request); }; module.exports = { @@ -81127,11 +81131,12 @@ const alertRequest = createAlertRequestFrom(allInputs()); console.log(`Creating alert with: ${JSON.stringify(alertRequest)}`); -opsgenie.alertV2.create(alertRequest, function (error, _) { +opsgenie.alertV2.create(alertRequest, function (error, result) { if (error) { core.setFailed(error.message); } else { console.log(`Request sent for creating new alert: ${alertRequest.message}`); + core.setOutput("request_id", result.requestId); } });