generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
24 lines (21 loc) · 736 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const core = require('@actions/core');
const main = require('./src/main');
async function run() {
try {
const webhookUrlInputId = 'webhookUrl';
core.setSecret(webhookUrlInputId);
const webhookUrlInput = core.getInput(webhookUrlInputId, { required: true });
const message = core.getInput('message', { required: true });
const status = core.getInput('status');
const title = core.getInput('title');
const titleBackgroundColor = core.getInput('titleBackgroundColor');
await main(webhookUrlInput, message, {
status,
title,
titleBackgroundColor,
});
} catch (error) {
core.setFailed(error.message);
}
}
run();