I'm trying to add 2 badges to my github repo readme, so I can see build status of my dev branch and master branch. I was able to add the badges (and they work too) but I'm not able to differentiate between the badge for master or dev.
Is there a way to add custom text something [dev|passing] [master|failing], etc?
You can use shields.io which provides quite a lot of badges.
They have one for travis and you can specify the left side text of the badge.
As an example for one of my repo:
The normal link:
Build branch : https://img.shields.io/travis/73VW/TechnicalReport/build.svg
Master branch: https://img.shields.io/travis/73VW/TechnicalReport.svg
Renders as:
A bit of custom:
https://img.shields.io/travis/73VW/TechnicalReport/build.svg?label=Whatever+You+Want https://img.shields.io/travis/73VW/TechnicalReport.svg?label=Master
Renders as:
This works this way: https://img.shields.io/travis/USER/REPO/BRANCH.svg?label=YOURLABEL
Be aware that the branch part is not needed if you want to use master branch.
I Agree this slows down a bit the load of your github (or whatever) page because shields.io is not really fast but this is cool.
And you can also change badge style:
: https://img.shields.io/travis/73VW/TechnicalReport.svg?style=plastic&label=Custom+Label
: https://img.shields.io/travis/73VW/TechnicalReport.svg?style=flat-square&label=Custom+Label
: https://img.shields.io/travis/73VW/TechnicalReport.svg?style=for-the-badge&label=Custom+Label
: https://img.shields.io/travis/73VW/TechnicalReport.svg?style=social&label=Custom+Label
Have fun!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With