Skip to content

fix(cli): avoid shell for GitHub auth token#2920

Merged
fahreddinozcan merged 2 commits into
upstash:masterfrom
mturac:izon/context7-2918-shellless-gh-token
Jul 17, 2026
Merged

fix(cli): avoid shell for GitHub auth token#2920
fahreddinozcan merged 2 commits into
upstash:masterfrom
mturac:izon/context7-2918-shellless-gh-token

Conversation

@mturac

@mturac mturac commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • invoke gh auth token directly instead of routing it through a shell
  • preserve environment-token precedence and unauthenticated fallback behavior
  • add regression coverage for direct invocation, environment tokens, and missing GitHub CLI behavior

Testing

  • pnpm --filter ctx7 exec vitest run src/__tests__/github.test.ts
  • pnpm --filter ctx7 test
  • pnpm --filter ctx7 typecheck
  • pnpm --filter ctx7 lint:check

Closes #2918

mturac and others added 2 commits July 17, 2026 14:21
Record why `gh auth token` must stay shell-free so the .cmd/.bat shim gap
is not "fixed" by re-adding `shell`, which would restore the cmd.exe
process that upstash#2918 is about.

- reset mock implementations between tests so they stop leaking
- assert listSkillsFromGitHub's result; the tests passed green without it
- cover the GH_TOKEN fallback, which was previously untested
- reword the changeset: execSync spawned a shell on every platform, and
  on Windows that shell was load-bearing rather than "unnecessary"
@fahreddinozcan
fahreddinozcan merged commit 23843e9 into upstash:master Jul 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ctx7 setup triggers a "Suspicious Node.js process behavior" EDR alert on Windows

2 participants