badges / badges/shields

GitHub file size badge doesn't work for some files

Open
#10,548 2 comments 1 reaction 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

This badge works for most files
https://img.shields.io/github/size/badges/shields/server.js
but there are some that cause a problem
https://img.shields.io/github/size/badges/shields/package.json
The reason this fails is because this causes us to look for a file called "package" and use json output format, rather than look for a file called "package.json"

### 🔗 Link to the badge

https://img.shields.io/github/size/badges/shields/package.json

### 💡 Possible Solution

We might need to switch `path` from a path param to a query param to solve this.

Contributor guide

Open the contributing guide

Research direction

Start with the GitHub size badge endpoint shown in the issue and trace how its path is parsed into a filename and output format. Reproduce the failing package.json URL and compare it with server.js; done means both badges resolve the intended complete filename and return the expected badge output.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.