Skip to content

feat: render API-omitted contributors and auto-refresh community.json#179

Merged
anxiangsir merged 1 commit into
mainfrom
feat/contributors-svg-force-add
May 29, 2026
Merged

feat: render API-omitted contributors and auto-refresh community.json#179
anxiangsir merged 1 commit into
mainfrom
feat/contributors-svg-force-add

Conversation

@anxiangsir
Copy link
Copy Markdown
Collaborator

@anxiangsir anxiangsir commented May 29, 2026

What

Two related fixes so both the README and the website show the full contributor list (now 17, including YunyaoYan), plus a new CI job to keep the website's community data fresh.

  1. docs/build_contributors_svg.py — add --add login[:count] to force-include a contributor the GitHub /contributors API omits; regenerate both themed README SVGs.
  2. docs/build_community_json.py — add the same --add flag; regenerate docs/page/assets/community.json (the data source for the website's contributors + stargazers blocks) → 17 contributors, refreshed stargazers.
  3. .github/workflows/update-community-json.yml — new daily-scheduled workflow that regenerates community.json automatically.

Why

Both the README SVG and the website source their contributor list exclusively from the GitHub /contributors REST API. That API only returns commits whose author email is linked to a GitHub account, and a freshly-merged first contribution can take time to be indexed — so YunyaoYan (PR #178) was missing from both surfaces.

Separately, community.json (contributors and stargazers) had no CI refreshing it — only the README SVG had an automated workflow. Stargazer counts on the site would drift stale.

How

  • --add login[:count] (both scripts): if the login is already returned by the API its count is overridden; otherwise it's appended with an avatar resolved via the users API (fallback github.com/<login>.png). List re-sorted by (-count, login).
  • New workflow mirrors the existing reademe-contributors.yml: reuses built-in GITHUB_TOKEN, guards against self-triggered infinite loops (github.actor != 'github-actions[bot]'), concurrency group, daily cron, commits only when the file changes. Pins --add YunyaoYan:1.

Verification

  • ruff check + ruff format --check: pass on both scripts
  • update-community-json.yml: valid YAML
  • README SVGs contain github.com/YunyaoYan (17 unique contributor links)
  • community.json: 17 contributors (incl. YunyaoYan), stargazers refreshed (970 → 988), structure unchanged

The GitHub contributors API only returns commits whose author email is
linked to a GitHub account, so contributors whose merges haven't yet been
indexed (or whose email isn't bound) never render in the SVG.

Add a repeatable --add login[:count] flag that force-includes a login,
resolving its avatar via the users API (falling back to github.com/<login>.png)
and overriding the API count when the login is already present. Regenerate
both themed SVGs to include YunyaoYan (PR #178), now 17 contributors.
Copilot AI review requested due to automatic review settings May 29, 2026 11:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@anxiangsir anxiangsir merged commit dc07f54 into main May 29, 2026
1 check passed
@anxiangsir anxiangsir changed the title feat: force-include contributors omitted by GitHub API feat: render API-omitted contributors and auto-refresh community.json May 29, 2026
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.

2 participants