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:
Salman Chishti 2026-04-08 21:39:12 +00:00 committed by GitHub
parent 95933befc0
commit f9d72d3f45
8 changed files with 169 additions and 63 deletions

View file

@ -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;