Skip to content

Commit

Permalink
remove example code
Browse files Browse the repository at this point in the history
  • Loading branch information
zeshanziya committed Jun 3, 2024
1 parent f53d367 commit 02654a4
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 208 deletions.
89 changes: 0 additions & 89 deletions __tests__/main.test.ts

This file was deleted.

25 changes: 0 additions & 25 deletions __tests__/wait.test.ts

This file was deleted.

2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
105 changes: 49 additions & 56 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/**
* The entrypoint for the action.
*/
import * as core from '@actions/core'
import { run } from './main'

// eslint-disable-next-line @typescript-eslint/no-floating-promises
run()
try {
run()
} catch (error) {
// Fail the workflow run if an error occurs
if (error instanceof Error) core.setFailed(error.message)
}
19 changes: 1 addition & 18 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
import * as core from '@actions/core'
import { wait } from './wait'

/**
* The main function for the action.
* @returns {Promise<void>} Resolves when the action is complete.
*/
export async function run(): Promise<void> {
try {
const ms: string = core.getInput('milliseconds')

// Debug logs are only output if the `ACTIONS_STEP_DEBUG` secret is true
core.debug(`Waiting ${ms} milliseconds ...`)

// Log the current timestamp, wait, then log the new timestamp
core.debug(new Date().toTimeString())
await wait(parseInt(ms, 10))
core.debug(new Date().toTimeString())

// Set outputs for other workflow steps to use
core.setOutput('time', new Date().toTimeString())
} catch (error) {
// Fail the workflow run if an error occurs
if (error instanceof Error) core.setFailed(error.message)
}
core.info('Inside custom action')
}
14 changes: 0 additions & 14 deletions src/wait.ts

This file was deleted.

0 comments on commit 02654a4

Please sign in to comment.