mirror of
https://github.com/actions/javascript-action.git
synced 2025-04-08 08:19:42 +00:00
22 lines
574 B
JavaScript
22 lines
574 B
JavaScript
const core = require('@actions/core');
|
|
const wait = require('./wait');
|
|
|
|
|
|
// most @actions toolkit packages have async methods
|
|
async function run() {
|
|
try {
|
|
const ms = core.getInput('milliseconds');
|
|
core.info(`Waiting ${ms} milliseconds ...`);
|
|
|
|
core.debug((new Date()).toTimeString()); // debug is only output if you set the secret `ACTIONS_RUNNER_DEBUG` to true
|
|
await wait(parseInt(ms));
|
|
core.info((new Date()).toTimeString());
|
|
|
|
core.setOutput('time', new Date().toTimeString());
|
|
} catch (error) {
|
|
core.setFailed(error.message);
|
|
}
|
|
}
|
|
|
|
run();
|