mirror of
https://github.com/actions/github-script.git
synced 2026-03-28 08:55:03 +00:00
feat: expose getOctokit in script context for multi-token workflows
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user