Skip to content

Commit

Permalink
ci:Action compiled by ncc [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
rockem committed May 4, 2024
1 parent f13560e commit 9f14791
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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);
}
});

Expand Down

0 comments on commit 9f14791

Please sign in to comment.