badges / shields

Concise, consistent, and legible badges in SVG and raster format

Home Page:https://shields.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Github Downloads badge reverts to zero when I overwrite a release asset

matinlotfali opened this issue Β· comments

Are you experiencing an issue with...

shields.io

🐞 Description

I have a GitHub workflow that generates new packages every night for my repository

Sadly, because packages are being overwritten on the nightly tag release, the total number of downloads revert to zero every night.

Is it possible to have the download counts of older files as well?

πŸ”— Link to the badge

https://img.shields.io/github/downloads/matinlotfali/KDE-Rounded-Corners/kwin4_effect_shapecorners_fedora40.rpm

πŸ’‘ Possible Solution

No response

Badge tested using npm run badge https://img.shields.io/github/downloads/matinlotfali/KDE-Rounded-Corners/kwin4_effect_shapecorners_fedora40.rpm
Output is available here

Hello. When we render this badge, we request https://api.github.com/repos/matinlotfali/KDE-Rounded-Corners/releases?per_page=500 then we find any assets with the name kwin4_effect_shapecorners_fedora40.rpm in that response and add up the values of download_count for any matching assets, which in this case gives us 0.
We don't store our own stats. We can only report the number GitHub tells us. If you wanted the download count from a previous asset with the same name to be retained, this is really a request for the GitHub API.

I understand now. Thank you for the explanation.