Cleanup of the template

This commit is contained in:
Michal Dorner 2020-10-01 23:35:59 +02:00
parent c4979203f6
commit e09b207f38
No known key found for this signature in database
GPG key ID: 9EEE04B48DA36786
13 changed files with 1409 additions and 1532 deletions

View file

@ -1,16 +1,8 @@
import * as core from '@actions/core'
import {wait} from './wait'
async function run(): Promise<void> {
try {
const ms: string = core.getInput('milliseconds')
core.debug(`Waiting ${ms} milliseconds ...`) // debug is only output if you set the secret `ACTIONS_RUNNER_DEBUG` to true
core.debug(new Date().toTimeString())
await wait(parseInt(ms, 10))
core.debug(new Date().toTimeString())
core.setOutput('time', new Date().toTimeString())
core.info('TODO')
} catch (error) {
core.setFailed(error.message)
}

View file

@ -1,9 +0,0 @@
export async function wait(milliseconds: number): Promise<string> {
return new Promise(resolve => {
if (isNaN(milliseconds)) {
throw new Error('milliseconds not a number')
}
setTimeout(() => resolve('done!'), milliseconds)
})
}