mirror of
https://github.com/actions/github-script.git
synced 2025-12-08 16:16:21 +00:00
Add pull-request-test workflow
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import * as core from '@actions/core'
|
||||
import {GitHub} from '@actions/github'
|
||||
import {Context} from '@actions/github/lib/context'
|
||||
import {GitHub} from '@actions/github/lib/utils'
|
||||
import * as io from '@actions/io'
|
||||
|
||||
const AsyncFunction = Object.getPrototypeOf(async () => null).constructor
|
||||
@@ -8,7 +8,7 @@ const AsyncFunction = Object.getPrototypeOf(async () => null).constructor
|
||||
type AsyncFunctionArguments = {
|
||||
context: Context
|
||||
core: typeof core
|
||||
github: GitHub
|
||||
github: InstanceType<typeof GitHub>
|
||||
io: typeof io
|
||||
require: NodeRequire
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as core from '@actions/core'
|
||||
import {context, GitHub} from '@actions/github'
|
||||
import {context, getOctokit} from '@actions/github'
|
||||
import * as io from '@actions/io'
|
||||
import {callAsyncFunction} from './async-function'
|
||||
|
||||
@@ -23,7 +23,7 @@ async function main(): Promise<void> {
|
||||
if (userAgent != null) opts.userAgent = userAgent
|
||||
if (previews != null) opts.previews = previews.split(',')
|
||||
|
||||
const github = new GitHub(token, opts)
|
||||
const github = getOctokit(token, opts)
|
||||
const script = core.getInput('script', {required: true})
|
||||
|
||||
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors.
|
||||
|
||||
Reference in New Issue
Block a user