mirror of
https://github.com/actions/github-script.git
synced 2026-04-09 07:30:05 +00:00
fix: rename binding to createOctokit and harden option merging
- 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
This commit is contained in:
parent
95933befc0
commit
f9d72d3f45
8 changed files with 169 additions and 63 deletions
2
types/async-function.d.ts
vendored
2
types/async-function.d.ts
vendored
|
|
@ -11,7 +11,7 @@ export declare type AsyncFunctionArguments = {
|
|||
core: typeof core;
|
||||
github: InstanceType<typeof GitHub>;
|
||||
octokit: InstanceType<typeof GitHub>;
|
||||
getOctokit: typeof getOctokit;
|
||||
createOctokit: typeof getOctokit;
|
||||
exec: typeof exec;
|
||||
glob: typeof glob;
|
||||
io: typeof io;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue