shields icon indicating copy to clipboard operation
shields copied to clipboard

Github releases badge rounds minor version to x.x, causing an incorrect version, when actual version is x.xx

Open rocknjohn opened this issue 8 years ago • 5 comments

If a repo has a two digit minor version, the releases badge is rounding it to one digit, causing an incorrect release version to be displayed:

Example: https://img.shields.io/github/release/whispersystems/signal-ios.svg

I've seen this twice: Actual version: 2.19 Shown version: 2.2

Actual version: 2.20 Shown version: 2.2

rocknjohn avatar Dec 07 '17 20:12 rocknjohn

No bueno! Thanks for the report.

Confirmed still broken in master. https://shields-staging.herokuapp.com/github/release/whispersystems/signal-ios.svg

Based on https://github.com/WhisperSystems/Signal-iOS/releases this should be 2.20.0.1 but I'm seeing 2.2.

If anyone would like to look into it, feel free! Adding a test with .intercept() is a great way to troubleshoot something like this.

paulmelnikow avatar Dec 07 '17 20:12 paulmelnikow

If I call https://api.github.com/repos/whispersystems/signal-ios/releases/latest I am getting back a response containing

{
...
  "tag_name": "2.2",
...
}

chris48s avatar Dec 07 '17 20:12 chris48s

Indeed… I wonder if the subsequent entries are actually releases. Maybe they are just tags.

If I go way back in the release history, some earlier ones are formatted differently: https://github.com/WhisperSystems/Signal-iOS/releases?after=2.2

The tag badge shows the number we want: https://img.shields.io/github/tag/whispersystems/signal-ios.svg

paulmelnikow avatar Dec 07 '17 21:12 paulmelnikow

Could it be they are just specifying release title and no tag version is specified so it just uses the latest tag version that can be found. (or vise-versa) image

Edit: It think the above might be the case: image https://github.com/WhisperSystems/Signal-iOS/releases/latest image

Edit2: Maybe not: https://github.com/WhisperSystems/Signal-iOS/releases/tag/2.20.0.1 image

RedSparr0w avatar Dec 07 '17 21:12 RedSparr0w

Seems the problem is that, despite the text in the UI, these are not releases, only tags. In other words, this is the expected behavior. Feel free to re-open if I've misunderstood!

paulmelnikow avatar Dec 22 '17 04:12 paulmelnikow