mirror of
https://github.com/actions/github-script.git
synced 2026-04-07 14:49:25 +00:00
Make node-fetch available
This commit is contained in:
parent
311d596c3d
commit
f34078a491
5 changed files with 35 additions and 6 deletions
|
|
@ -4,6 +4,7 @@ import {Context} from '@actions/github/lib/context'
|
|||
import {GitHub} from '@actions/github/lib/utils'
|
||||
import * as glob from '@actions/glob'
|
||||
import * as io from '@actions/io'
|
||||
import fetch from 'node-fetch'
|
||||
|
||||
const AsyncFunction = Object.getPrototypeOf(async () => null).constructor
|
||||
|
||||
|
|
@ -14,6 +15,7 @@ type AsyncFunctionArguments = {
|
|||
exec: typeof exec
|
||||
glob: typeof glob
|
||||
io: typeof io
|
||||
fetch: typeof fetch
|
||||
require: NodeRequire
|
||||
__original_require__: NodeRequire
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import {RequestRequestOptions} from '@octokit/types'
|
|||
import {callAsyncFunction} from './async-function'
|
||||
import {getRetryOptions, parseNumberArray, RetryOptions} from './retry-options'
|
||||
import {wrapRequire} from './wrap-require'
|
||||
import fetch from 'node-fetch'
|
||||
|
||||
process.on('unhandledRejection', handleError)
|
||||
main().catch(handleError)
|
||||
|
|
@ -56,7 +57,8 @@ async function main(): Promise<void> {
|
|||
core,
|
||||
exec,
|
||||
glob,
|
||||
io
|
||||
io,
|
||||
fetch
|
||||
},
|
||||
script
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue