Initial commit

This commit is contained in:
Drew Heavner
2019-11-08 22:06:29 -05:00
commit d665ce5758
14 changed files with 5733 additions and 0 deletions

19
src/main.ts Normal file
View File

@@ -0,0 +1,19 @@
import * as core from '@actions/core';
import {wait} from './wait'
async function run() {
try {
const ms = core.getInput('milliseconds');
console.log(`Waiting ${ms} milliseconds ...`)
core.debug((new Date()).toTimeString())
await wait(parseInt(ms, 10));
core.debug((new Date()).toTimeString())
core.setOutput('time', new Date().toTimeString());
} catch (error) {
core.setFailed(error.message);
}
}
run();

10
src/wait.ts Normal file
View File

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