Skip to content

Commit 77e1066

Browse files
committed
add Github Key
1 parent c08c0fe commit 77e1066

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
package-manager: bun@latest
3333
env:
3434
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
35+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
3536

3637
deploy:
3738
needs: build

src/lib/githubFetcher.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function parseRateLimitHeaders(headers: Headers): RateLimitInfo | null {
4747

4848
// Get auth headers
4949
// Token can be set via:
50-
// 1. Environment variable GITHUB_TOKEN (set in .env file)
50+
// 1. Environment variable GITHUB_TOKEN or GH_TOKEN (set in .env file or CI)
5151
// 2. localStorage "github_token" (for user-provided tokens)
5252
//
5353
// To get a GitHub token:
@@ -60,8 +60,9 @@ function getAuthHeaders(): Record<string, string> {
6060
"Accept": "application/vnd.github.v3+json",
6161
};
6262

63-
// First check environment variable (build-time or SSR)
64-
const envToken = import.meta.env.GITHUB_TOKEN;
63+
// First check environment variables (build-time or SSR)
64+
// Check both GITHUB_TOKEN and GH_TOKEN for flexibility
65+
const envToken = import.meta.env.GITHUB_TOKEN || import.meta.env.GH_TOKEN;
6566
if (envToken) {
6667
headers["Authorization"] = `Bearer ${envToken}`;
6768
return headers;

0 commit comments

Comments
 (0)