mirror of
https://github.com/dorny/paths-filter.git
synced 2025-06-08 00:59:04 +00:00
Initial commit
This commit is contained in:
commit
b78de5e86b
17 changed files with 7306 additions and 0 deletions
19
src/main.ts
Normal file
19
src/main.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
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 ...`)
|
||||
|
||||
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()
|
9
src/wait.ts
Normal file
9
src/wait.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
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)
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue