Commit graph

3 commits

Author SHA1 Message Date
Salman Chishti
599b1f4052 style: fix prettier formatting 2026-04-08 21:46:34 +00:00
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
95933befc0 feat: wrap getOctokit with configured defaults
Extract createConfiguredGetOctokit factory that wraps getOctokit with:
- retry and requestLog plugins (from action defaults)
- retries count, proxy agent, orchestration ID user-agent
- deep-merge for request options so user overrides don't clobber retries
- plugin deduplication to prevent double-application

This ensures secondary Octokit clients created via getOctokit() in
github-script workflows inherit the same defaults as the primary
github client.
2026-04-08 20:47:58 +00:00