mirror of
https://github.com/actions/github-script.git
synced 2026-04-09 07:30:05 +00:00
- Rename context binding from getOctokit to createOctokit to avoid
SyntaxError when users write const { getOctokit } = require(...)
in their scripts (~10 public workflows affected)
- Strip undefined values from user options to prevent clobbering
defaults (e.g. GHES baseUrl)
- Deep-merge retry options alongside request options
- Use nullish coalescing (??) instead of logical OR (||)
- Shallow-copy opts to prevent shared reference mutation
- Add tests: undefined stripping, retry merge, falsy value preservation,
no mutation of defaults
- 32 tests passing, lint clean, dist rebuilt
21 lines
786 B
TypeScript
21 lines
786 B
TypeScript
/// <reference types="node" />
|
|
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';
|
|
export declare type AsyncFunctionArguments = {
|
|
context: Context;
|
|
core: typeof core;
|
|
github: InstanceType<typeof GitHub>;
|
|
octokit: InstanceType<typeof GitHub>;
|
|
createOctokit: typeof getOctokit;
|
|
exec: typeof exec;
|
|
glob: typeof glob;
|
|
io: typeof io;
|
|
require: NodeRequire;
|
|
__original_require__: NodeRequire;
|
|
};
|
|
export declare function callAsyncFunction<T>(args: AsyncFunctionArguments, source: string): Promise<T>;
|