-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
35 lines (27 loc) · 941 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
27
28
29
30
31
32
33
34
35
const core = require('@actions/core');
const icaltools = require('./icaltools');
async function run() {
try {
let iCalAddress = core.getInput('ical-address');
let eventSummary = core.getInput('event-summary');
let lookoutDays = core.getInput('lookout-days');
console.log(`
Processing...
iCal URL = ${iCalAddress}
Event Name = ${eventSummary}
Days to look ahead = ${lookoutDays}
`);
const event = await icaltools.getNextEvent(iCalAddress, eventSummary, lookoutDays);
console.log("Returned... ");
for(let key in event) {
core.setOutput(key, event[key])
console.log(` ${key}: ${event[key]}`);
}
// Get the JSON webhook payload for the event that triggered the workflow
// const payload = JSON.stringify(github.context.payload, undefined, 2)
// console.log(`The event payload: ${payload}`);
} catch (error) {
core.setFailed(error.toString());
}
}
run()