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

Wrong amount of stars

Open shadowoff09 opened this issue 1 year ago • 4 comments
trafficstars

Hey, my script is saying that i have 2009 stars, and i dont know from where that value comes from because i dont that many stars.

shadowoff09 avatar Nov 08 '24 14:11 shadowoff09

Hi @shadowoff09! There are a number of reasons this could be happening. This code counts the stars (and stats) of any repo you have contributed to, or any repo that marks you as a "contributor." You can be added to a repo as a contributor even if you haven not pushed any commits to it.

https://github.com/jstrieb/github-stats/blob/ce37fed0508deef4a208041b5b148fbe2918b1c0/github_stats.py#L167-L172

If you only want to show owned repositories, set the environment variable EXCLUDE_FORKED_REPOS=true wherever this code is running (GitHub Actions or elsewhere).

https://github.com/jstrieb/github-stats/blob/ce37fed0508deef4a208041b5b148fbe2918b1c0/generate_images.py#L118-L122

jstrieb avatar Nov 08 '24 14:11 jstrieb

Thank you for the reponse @jstrieb.

The variable EXCLUDE_FORKED_REPOS is set to true in the main workflow, and the stars are still the same.

As you can see here: https://github.com/shadowoff09/github-stats/blob/master/.github/workflows/main.yml

shadowoff09 avatar Nov 08 '24 17:11 shadowoff09

Same issue +1 1731106355898

yewentao256 avatar Nov 08 '24 22:11 yewentao256

I think you need to specify the variable in the main.yaml file

andrewboldi avatar Apr 24 '25 21:04 andrewboldi

@jstrieb EXCLUDE_FORKED_REPOS is true in my workflow, but it still counts stars and languages from a repo I have contributed to: https://github.com/Giorgi/github-stats/blob/7660e5a6b147e252c4826ea93807eb47f6255c2d/.github/workflows/main.yml#L45

Giorgi avatar Jul 27 '25 19:07 Giorgi