@process-engine/ci_tools
Version:
CI tools for process-engine.io
23 lines • 767 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.sendSlackMessage = void 0;
const cross_fetch_1 = require("cross-fetch");
function sendSlackMessage(message) {
const body = {
text: message,
};
return (0, cross_fetch_1.default)(getSlackWebhook(), {
method: 'post',
body: JSON.stringify(body),
headers: { 'Content-Type': 'application/json' },
});
}
exports.sendSlackMessage = sendSlackMessage;
function getSlackWebhook() {
const webhook = process.env.SLACK_WEBHOOK;
if (webhook === undefined) {
throw new Error("The slack incoming webhook URL must be configured as environment variable 'SLACK_WEBHOOK'!");
}
return webhook;
}
//# sourceMappingURL=notifier.js.map
;