typescript-action/src/main.ts

20 lines
455 B
TypeScript
Raw Normal View History

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(): Promise<void> {
2019-07-22 18:15:40 +00:00
try {
const ms: string = core.getInput('milliseconds')
core.debug(`Waiting ${ms} milliseconds ...`)
2019-09-21 12:56:30 +00:00
core.debug(new Date().toTimeString())
await wait(parseInt(ms, 10))
core.debug(new Date().toTimeString())
2019-09-21 12:56:30 +00:00
core.setOutput('time', new Date().toTimeString())
2019-07-22 18:15:40 +00:00
} catch (error) {
core.setFailed(error.message)
2019-07-22 18:15:40 +00:00
}
}
run()