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 {GitHub} from '@actions/github/lib/utils'
|
||||||
import * as glob from '@actions/glob'
|
import * as glob from '@actions/glob'
|
||||||
import * as io from '@actions/io'
|
import * as io from '@actions/io'
|
||||||
|
import type {OctokitOptions, OctokitPlugin} from '@octokit/core/types'
|
||||||
|
|
||||||
const AsyncFunction = Object.getPrototypeOf(async () => null).constructor
|
const AsyncFunction = Object.getPrototypeOf(async () => null).constructor
|
||||||
|
|
||||||
@@ -12,6 +13,11 @@ export declare type AsyncFunctionArguments = {
|
|||||||
core: typeof core
|
core: typeof core
|
||||||
github: InstanceType<typeof GitHub>
|
github: InstanceType<typeof GitHub>
|
||||||
octokit: InstanceType<typeof GitHub>
|
octokit: InstanceType<typeof GitHub>
|
||||||
|
getOctokit: (
|
||||||
|
token: string,
|
||||||
|
options?: OctokitOptions,
|
||||||
|
...additionalPlugins: OctokitPlugin[]
|
||||||
|
) => InstanceType<typeof GitHub>
|
||||||
exec: typeof exec
|
exec: typeof exec
|
||||||
glob: typeof glob
|
glob: typeof glob
|
||||||
io: typeof io
|
io: typeof io
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ async function main(): Promise<void> {
|
|||||||
__original_require__: __non_webpack_require__,
|
__original_require__: __non_webpack_require__,
|
||||||
github,
|
github,
|
||||||
octokit: github,
|
octokit: github,
|
||||||
|
getOctokit,
|
||||||
context,
|
context,
|
||||||
core,
|
core,
|
||||||
exec,
|
exec,
|
||||||
|
|||||||
Reference in New Issue
Block a user