typescript-action/src/main.ts

20 lines
443 B
TypeScript
Raw Normal View History

2019-07-22 18:15:40 +00:00
import * as core from '@actions/core';
2019-09-21 12:56:30 +00:00
import {wait} from './wait'
2019-07-22 18:15:40 +00:00
async function run() {
try {
2019-09-21 12:56:30 +00:00
const ms = core.getInput('milliseconds');
console.log(`Waiting ${ms} milliseconds ...`)
core.debug((new Date()).toTimeString())
2019-10-10 03:17:08 +00:00
await wait(parseInt(ms, 10));
2019-09-21 12:56:30 +00:00
core.debug((new Date()).toTimeString())
core.setOutput('time', new Date().toTimeString());
2019-07-22 18:15:40 +00:00
} catch (error) {
core.setFailed(error.message);
}
}
run();