Skip to content

feat: global token#57

Merged
masonlet merged 3 commits into
mainfrom
feat/global-token
Jul 13, 2026
Merged

feat: global token#57
masonlet merged 3 commits into
mainfrom
feat/global-token

Conversation

@masonlet

Copy link
Copy Markdown
Member

Summary

Adds an optional deployment-wide GITHUB_TOKEN used as a fallback for any source without its own token. Previously, token-less sources hit GitHub anonymously; 60 req/hr shared across every token-less source. With a global token set, "no per-source token" still means authenticated at 5,000 req/hr.

Behavior

  • Per-source token always wins
  • The global token only adds an Authorization header; username sources keep the public /users/{name}/repos endpoint. Only a per-source token switches to /user/repos for private-repo listing.

Changes

  • src/github/fetch.ts: resolve token = source.token ?? globalToken per source.
  • tests/github/fetch.test.ts: fallback applied without URL switch, per-source precedence, whitespace-only token; suite now stubs GITHUB_TOKEN so a real env token can't leak in.
  • .env.example, README (config docs + Vercel deploy button env list).

@masonlet
masonlet merged commit 6f68efa into main Jul 13, 2026
5 checks passed
@masonlet
masonlet deleted the feat/global-token branch July 13, 2026 21:24
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.

1 participant