github-readme-stats icon indicating copy to clipboard operation
github-readme-stats copied to clipboard

Github Stats card: Private commits count actually counts private contributions

Open harry-graham opened this issue 3 years ago • 2 comments

Discussed in https://github.com/anuraghazra/github-readme-stats/discussions/2498.

Overview

On the Github stats card, when using the option count_private, it is supposed to include private commits in the total commits count. However, it actually includes private contributions in the total commits count, which is not the same thing, as explained here.

Details

The option on the stats card:

image

The code used to generate the total commit number actually uses a private contributions value from the Github API:

image

The property in the Github GraphQL API schema file, along with the comment of what it represents:

image

harry-graham avatar Feb 05 '23 21:02 harry-graham

@harry-graham Thanks for bringing the distinction to our attention! The documentation could indeed be updated. Please feel free to create a PR, and I will review it. The best way to get correct commits is to remove the count_private property and deploy your Vercel instance (see https://github.com/anuraghazra/github-readme-stats#deploy-on-your-own-vercel-instance). GRS will then have access to your private commits.

rickstaa avatar Feb 07 '23 10:02 rickstaa

I think we should remove the count_private option altogether, unless we plan to add a totalContributions field in the future.

See #2504 (comment).

Zo-Bro-23 avatar Feb 09 '23 10:02 Zo-Bro-23

Followed up by #2517.

rickstaa avatar Feb 14 '23 13:02 rickstaa