actions-hugo/index.js

37 lines
850 B
JavaScript
Raw Normal View History

const core = require('@actions/core');
2019-09-15 17:22:08 +02:00
// const wait = require('./wait');
2019-09-15 17:22:08 +02:00
let hugoVersion = '';
2019-09-15 17:26:11 +02:00
let extended = '';
// most @actions toolkit packages have async methods
async function run() {
2019-09-15 13:24:31 +02:00
try {
2019-09-15 17:04:26 +02:00
// const ms = core.getInput('milliseconds');
// console.log(`Waiting ${ms} milliseconds ...`)
2019-09-15 17:04:26 +02:00
// core.debug((new Date()).toTimeString())
// wait(parseInt(ms));
// core.debug((new Date()).toTimeString())
2019-09-15 17:04:26 +02:00
// core.setOutput('time', new Date().toTimeString());
2019-09-15 13:24:31 +02:00
2019-09-15 17:22:08 +02:00
hugoVersion = core.getInput('hugo-version');
if (!hugoVersion) {
hugoVersion = 'latest';
}
2019-09-15 13:24:31 +02:00
console.log('Hugo version:', hugoVersion);
2019-09-15 17:26:11 +02:00
extended = core.getInput('extended');
if (!extended) {
extended = false;
}
2019-09-15 13:24:31 +02:00
console.log('Hugo extended:', extended);
}
catch (error) {
core.setFailed(error.message);
}
}
run()