-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
26 lines (21 loc) · 986 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
25
26
const core = require('@actions/core');
const Action = require('./action');
async function exec() {
try {
/* eslint max-len: "off" */
if (!(process.env.AQUA_BASE_URL || core.getInput('aqua-base-url'))) throw new Error('Please specify aqua-base-url as input or AQUA_BASE_URL as env');
if (!(process.env.AQUA_TOKEN || core.getInput('aqua-token'))) throw new Error('Please specify aqua-token as input or AQUA_TOKEN as env');
if (!core.getInput('defect')) throw new Error('Please specify defect as input');
if (!core.getInput('transition')) throw new Error('Please specify transition as input');
const argv = {
baseUrl: process.env.AQUA_BASE_URL || core.getInput('aqua-base-url'),
token: process.env.AQUA_TOKEN || core.getInput('aqua-token'),
defect: core.getInput('defect'),
transition: core.getInput('transition'),
};
await new Action({argv}).execute();
} catch (error) {
core.setFailed(error.toString());
}
}
exec();