Shields: Can't override labelColor in custom endpoint badge with query string

Created on 2 Nov 2020  ·  3Comments  ·  Source: badges/shields

Are you experiencing an issue with...

  • [X] [shields.io](https://shields.io/#/)
  • [ ] My own instance
  • [ ] [badge-maker NPM package](https://www.npmjs.com/package/badge-maker)

:beetle: Description

Can't override labelColor with custom endpoint badge.
https://img.shields.io/endpoint
Here it says that labelColor should be overridable by query string, but I can't seem to get it to work. My other badges work fine, it's just this one that doesn't.

:link: Link to the badge

https://img.shields.io/endpoint?label=build&style=for-the-badge&labelColor=black&url=https%3A%2F%2Factions-badge.atrox.dev%2Fbiolab%2Forange3%2Fbadge

:bulb: Possible Solution

🤷‍♀️

question

Most helpful comment

Thanks for the ping. It is good to know that isError should not be set in that case. I'll fix it in my project.

PS: thank you very much for shields.io

All 3 comments

Hi, thanks for the report. I think because that badge is an error badge, it's preventing the query string color overrides from applying.

I think in your case you should not set { isError: true } on a build failure. A build failure is not an error. Reserve { isError: true } for situations where someone asks for a project that doesn't exist, or if a server error occurs.

If you're interested, it would be great to have a PR to improve the documentation around these aspects of the badge!

Paging @Atrox, who wrote Atrox/github-actions-badge

Thanks for the ping. It is good to know that isError should not be set in that case. I'll fix it in my project.

PS: thank you very much for shields.io

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PyvesB picture PyvesB  ·  3Comments

chadwhitacre picture chadwhitacre  ·  4Comments

najeeb-ur-rehman picture najeeb-ur-rehman  ·  3Comments

calebcartwright picture calebcartwright  ·  3Comments

calebcartwright picture calebcartwright  ·  3Comments