Repository navigation
feat: 贡献数据支持官方 GraphQL 渠道并保留兜底 - #35
Merged
Merged
Conversation
提供 GITHUB_TOKEN 时优先调用 GitHub 官方 contributionsCollection,未提供时回落到无需认证的 gh-calendar。两个驱动统一为一年窗口与同一数据结构,并新增严格相等比较脚本;action 新增可选 token 输入。
flycran
force-pushed
the
feat/contributions-driver
branch
from
November 6, 2026 08:54
46bffe7 to
d9aa6c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更
fetchContributionsFromGraphql:GitHub 官方contributionsCollection,处理 HTTP 错误、200 +errors数组、用户不存在fetchContributionsFromCalendar:原有 gh-calendar 公共 APIGITHUB_TOKEN时优先官方渠道,未提供时回落到 gh-calendar(fetchContributions内选择)total按窗口重新累计token输入,main.ts读取后写入环境变量scripts/compareContributions.ts(bun run compare:contributions)做两驱动严格相等比较,不进单测验证
bun test:112 pass / 0 failbiome check .、tsc --noEmit通过dist/已重建两驱动比较结果
除 2026-03-07、2026-03-09 两天的 count 外逐字段相等(53 周、366 天、total 578 均一致)。差异来自 gh-calendar 上游缓存与官方实时数据不同,重复请求稳定复现,驱动层无法消除;因此比较脚本会以退出码 1 报告不等。