From 00afa0fed20254e2eee8e4ac475eb7afbaeb25df Mon Sep 17 00:00:00 2001 From: Salman Chishti Date: Sun, 1 Mar 2026 00:25:52 +0000 Subject: [PATCH] feat: expose `getOctokit` in script context for multi-token workflows --- src/async-function.ts | 6 ++++++ src/main.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/src/async-function.ts b/src/async-function.ts index 84035f2..56fb239 100644 --- a/src/async-function.ts +++ b/src/async-function.ts @@ -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 octokit: InstanceType + getOctokit: ( + token: string, + options?: OctokitOptions, + ...additionalPlugins: OctokitPlugin[] + ) => InstanceType exec: typeof exec glob: typeof glob io: typeof io diff --git a/src/main.ts b/src/main.ts index cbf6569..a01e1b7 100644 --- a/src/main.ts +++ b/src/main.ts @@ -66,6 +66,7 @@ async function main(): Promise { __original_require__: __non_webpack_require__, github, octokit: github, + getOctokit, context, core, exec,