generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
8,457 additions
and
719 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,19 @@ | ||
import {wait} from '../src/wait' | ||
import * as process from 'process' | ||
import * as cp from 'child_process' | ||
import * as path from 'path' | ||
import {expect, test} from '@jest/globals' | ||
import {test} from '@jest/globals' | ||
|
||
test('throws invalid number', async () => { | ||
const input = parseInt('foo', 10) | ||
await expect(wait(input)).rejects.toThrow('milliseconds not a number') | ||
}) | ||
|
||
test('wait 500 ms', async () => { | ||
const start = new Date() | ||
await wait(500) | ||
const end = new Date() | ||
var delta = Math.abs(end.getTime() - start.getTime()) | ||
expect(delta).toBeGreaterThan(450) | ||
}) | ||
|
||
// shows how the runner will run a javascript action with env / stdout protocol | ||
test('test runs', () => { | ||
process.env['INPUT_MILLISECONDS'] = '500' | ||
// process.env['INPUT_GITHUB_TOKEN'] = '' | ||
// process.env['INPUT_REPO'] = '' | ||
// process.env['INPUT_CURRENT_TAG'] = '' | ||
// process.env['INPUT_PREVIOUS_TAG'] = '' | ||
|
||
const np = process.execPath | ||
const ip = path.join(__dirname, '..', 'lib', 'main.js') | ||
const options: cp.ExecFileSyncOptions = { | ||
env: process.env | ||
} | ||
|
||
console.log(cp.execFileSync(np, [ip], options).toString()) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,22 @@ | ||
name: 'Your name here' | ||
description: 'Provide a description here' | ||
author: 'Your name or organization here' | ||
name: Get merged pull requests | ||
description: Compare 2 tags and retrieve all pull requests merged between them | ||
author: Van Ons | ||
inputs: | ||
milliseconds: # change this | ||
github_token: | ||
description: The GitHub token to use. | ||
required: true | ||
description: 'input description here' | ||
default: 'default value if applicable' | ||
repo: | ||
description: 'The repository to use. Defaults to current repository. Expected format: owner/repo' | ||
required: false | ||
current_tag: | ||
description: The current tag to use. Defaults to current/latest tag. | ||
required: false | ||
previous_tag: | ||
description: The previous tag to use. Defaults to one tag before the current tag. | ||
required: false | ||
outputs: | ||
pull_requests: | ||
description: The pull requests merged between the 2 tags. | ||
runs: | ||
using: 'node16' | ||
main: 'dist/index.js' | ||
using: node16 | ||
main: dist/index.js |
Oops, something went wrong.