mirror of
https://github.com/actions/github-script.git
synced 2026-04-07 14:49:25 +00:00
feat: expose getOctokit in script context for multi-token workflows
This commit is contained in:
parent
450193c5ab
commit
00afa0fed2
2 changed files with 7 additions and 0 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 type {OctokitOptions, OctokitPlugin} from '@octokit/core/types'
|
||||
|
||||
const AsyncFunction = Object.getPrototypeOf(async () => null).constructor
|
||||
|
||||
|
|
@ -12,6 +13,11 @@ export declare type AsyncFunctionArguments = {
|
|||
core: typeof core
|
||||
github: InstanceType<typeof GitHub>
|
||||
octokit: InstanceType<typeof GitHub>
|
||||
getOctokit: (
|
||||
token: string,
|
||||
options?: OctokitOptions,
|
||||
...additionalPlugins: OctokitPlugin[]
|
||||
) => InstanceType<typeof GitHub>
|
||||
exec: typeof exec
|
||||
glob: typeof glob
|
||||
io: typeof io
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ async function main(): Promise<void> {
|
|||
__original_require__: __non_webpack_require__,
|
||||
github,
|
||||
octokit: github,
|
||||
getOctokit,
|
||||
context,
|
||||
core,
|
||||
exec,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue