From 00afa0fed20254e2eee8e4ac475eb7afbaeb25df Mon Sep 17 00:00:00 2001 From: Salman Chishti Date: Sun, 1 Mar 2026 00:25:52 +0000 Subject: [PATCH 1/2] 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 84035f222..56fb2398a 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 cbf65693c..a01e1b74e 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, From a7dc0e4fc1f13a563d93a9fdb7f827f9e8fd69ce Mon Sep 17 00:00:00 2001 From: Salman Chishti Date: Sun, 1 Mar 2026 01:30:49 +0000 Subject: [PATCH 2/2] fix: use typeof getOctokit instead of deep @octokit/core import, rebuild dist/ --- src/async-function.ts | 8 ++------ types/async-function.d.ts | 2 ++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/async-function.ts b/src/async-function.ts index 56fb2398a..7f928b4ca 100644 --- a/src/async-function.ts +++ b/src/async-function.ts @@ -1,10 +1,10 @@ import * as core from '@actions/core' import * as exec from '@actions/exec' +import {getOctokit} from '@actions/github' 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 @@ -13,11 +13,7 @@ export declare type AsyncFunctionArguments = { core: typeof core github: InstanceType octokit: InstanceType - getOctokit: ( - token: string, - options?: OctokitOptions, - ...additionalPlugins: OctokitPlugin[] - ) => InstanceType + getOctokit: typeof getOctokit exec: typeof exec glob: typeof glob io: typeof io diff --git a/types/async-function.d.ts b/types/async-function.d.ts index b204e3639..3c2de8e28 100644 --- a/types/async-function.d.ts +++ b/types/async-function.d.ts @@ -1,6 +1,7 @@ /// import * as core from '@actions/core'; import * as exec from '@actions/exec'; +import { getOctokit } from '@actions/github'; import { Context } from '@actions/github/lib/context'; import { GitHub } from '@actions/github/lib/utils'; import * as glob from '@actions/glob'; @@ -10,6 +11,7 @@ export declare type AsyncFunctionArguments = { core: typeof core; github: InstanceType; octokit: InstanceType; + getOctokit: typeof getOctokit; exec: typeof exec; glob: typeof glob; io: typeof io;