Skip to content

Add personal contribution language stats #4885

Closed
andrecollar wants to merge 5 commits into
anuraghazra:masterfrom
andrecollar:master
Closed

Add personal contribution language stats #4885
andrecollar wants to merge 5 commits into
anuraghazra:masterfrom
andrecollar:master

Conversation

@andrecollar

@andrecollar andrecollar commented May 17, 2026

Copy link
Copy Markdown

Summary

Adds an optional personal_contributions=true mode for the Top Languages card.
This mode calculates language usage from additions in commits authored by the requested user, instead of using repository-wide language totals. It is useful for users whose work happens mostly in organization repositories they do not own.

New query parameters

  • personal_contributions=true
  • orgs=org1,org2
  • personal_pages=2
  • personal_limit=40

Notes

  • Requires a self-hosted instance with a GitHub token for private organization repositories.
  • Counts authored commit additions, not current line ownership via git blame.
  • Uses personal_limit to keep serverless execution bounded.
  • For private organization repositories, classic tokens need repo and read:org; SAML/SSO organizations require token authorization.

Tests

npx.cmd prettier --check readme.md
npx.cmd eslint --max-warnings 0 src\fetchers\personal-contribution-languages.js api\top-langs.js tests\fetchPersonalContributionLanguages.test.js 
npm.cmd test -- --runTestsByPath tests\top-langs.test.js tests\fetchTopLanguages.test.js      tests\fetchPersonalContributionLanguages.test.js

@vercel

vercel Bot commented May 17, 2026

Copy link
Copy Markdown

@andrecollar is attempting to deploy a commit to the github readme stats Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added documentation Improvements or additions to documentation. lang-card Issues related to the language card. labels May 17, 2026
@martin-mfg

Copy link
Copy Markdown
Collaborator

Thanks for the PR!

Maintenance of this project has moved to https://github.com/stats-organization/github-stats-extended (see here for context). It would be great if you could adapt your code changes to that repository and then open a PR there.

Also, please use this file from GitHub for the language detection logic. This will ensure consistency with GitHub's language detection and is a comprehensive list of possible languages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation. lang-card Issues related to the language card.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants