badges / badges/shields

Total downloads does not count all releases

Open Beginner friendly
#6,766 5 comments 3 reactions 0 assignees View on GitHub
bug service-badge
Dominant language
JavaScript
Stars
27.2k
Forks
5.6k
Avg merge
1d 8h
Merged PRs (30d)
46

Description

### Are you experiencing an issue with...

shields.io

### 🐞 Description

The number in the total downloads badge for our repo has been fluctuating lately. We believe the issue is the badge is only counting downloads for the most recent 500 releases, instead of paging over all API result pages for every release.

### 🔗 Link to the badge

https://img.shields.io/github/downloads/aquasecurity/tfsec/total

### 💡 Possible Solution

Iterate over each page of the GitHub API call results using `per_page=1000` and `page=N`.

I think the issue is here: https://github.com/badges/shields/blob/23c0406bedfc6930735e8f5ea75dfe34faf1f290/services/github/github-downloads.service.js#L246-L251

Contributor guide

Open the contributing guide

Research direction

Start by reading services/github/github-downloads.service.js around lines 246-251 and inspect how the GitHub releases API results are fetched. Verify the total downloads badge for the linked tfsec repository includes releases beyond the first 500 and remains correct when results span multiple API pages.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, javascript
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.