forked from rnkdsh/action-upload-diawi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
38 lines (34 loc) · 1.06 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
const core = require('@actions/core');
const Diawi = require('./diawi.js');
async function run() {
try {
const parameters = {
token: core.getInput('token'),
path: core.getInput('file'),
password: core.getInput('password'),
callback_emails: core.getInput('recipients'),
wall_of_apps: core.getInput('wall_of_apps') === true ? 1 : 0,
installation_notifications: core.getInput('installation_notifications') === true ? 1 : 0,
find_by_udid: core.getInput('find_by_udid') === true ? 1 : 0,
comment: core.getInput('comment'),
};
//console.log(`Parameters: ${parameters}`)
const diawiCommand = new Diawi(parameters)
.on('complete', function (url) {
console.log(url);
core.setOutput('url', url);
})
.on('error', function (error) {
console.error('Failed: ', error);
core.setFailed(error.message);
process.exit(1);
});
if (!core.getInput('dry-run')) {
diawiCommand.execute();
}
}
catch (error) {
core.setFailed(error.message);
}
}
run()