Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "github-gravity",
"description": "Generate an animated SVG of your GitHub contribution graph falling under gravity, with custom text as collision obstacles",
"version": "3.4.0",
"version": "3.4.1",
"author": "flycran",
"type": "module",
"private": true,
Expand Down
7 changes: 6 additions & 1 deletion src/utils/githubContributions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,12 @@ export async function fetchContributions(
username: string,
options: FetchContributionsOptions = {}
): Promise<CalendarResponse> {
const token = options.token?.trim() || process.env.GITHUB_TOKEN?.trim()
// web 播放器在浏览器里运行,没有 process,按无 token 处理
const envToken =
typeof process === 'undefined'
? undefined
: process.env.GITHUB_TOKEN?.trim()
const token = options.token?.trim() || envToken

if (token) {
return fetchContributionsFromGraphql(username, token, options.limit)
Expand Down
Loading