Commit graph

6 commits

Author SHA1 Message Date
Salman Chishti
f9d72d3f45 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
2026-04-08 21:40:43 +00:00
Salman Chishti
a7dc0e4fc1 fix: use typeof getOctokit instead of deep @octokit/core import, rebuild dist/ 2026-03-01 01:30:49 +00:00
Vladimir Starkov
632050422e fix: adjust types 2025-01-31 11:55:53 +01:00
Josh Gross
84903f5182
Remove node-fetch from type 2023-11-08 09:54:09 -05:00
Viktor Lott
56bdc6c318 Expose async-function argument type
We are exposing the async-function argument type for jsDoc
type declaration support. This means that we now could do:
"npm i -D @types/github-script@github:actions/github-script"
and the add:
"@param {import('@types/github-script').AsyncFunctionArguments}
AsyncFunctionArguments".

This could obviously be done in other ways too, like using
"@typed-actions/github-script" instead. But it seems better
to use the actual source repository instead of a third-party
library to import the type declaration.
2023-07-03 13:56:46 +02:00
Jonathan Clem
c416f56b51
Pass nativeRequire, as well 2021-04-21 16:40:48 -04:00