Badges… We don’t need no stinkin’ badges!

Well… Maybe we do. This is a quick plug (no reimbursement of any kind) for the folks over at Shields.io, who make creating custom badges for readme files and websites an easy and fun task.

A Quick Demo

License for spyder007/MMM-PrometheusAlerts
Build Status for spyder007/MMM-PrometheusAlerts

The badges above are generated from Shields.io. The first link looks like this:

https://img.shields.io/github/license/spyder007/MMM-PrometheusAlerts

My Github username (spyder007) and the repository name (MMM-PrometheusAlerts) are used in the Image URL, which generates the badge. The second one, build status, looks like this:

https://img.shields.io/github/actions/workflow/status/spyder007/MMM-PrometheusAlerts/node.js.yml

In this case, my Github username and the repository name remain the same, but node.js.yml is the name of the workflow file for which I want to display the status.

Every badge in Shields.io has a “builder” page that explains how to build the image and even allows you to override styles, colors, and labels, and even add logos from any icon in the Simple Icons collection.

Some examples of alterations to my build status above:

“For the Badge” style, Bugatti Logo with custom color
Flat style, CircleCI logo, Custom label

Too many options to list…

Now, these are live badges, meaning, if my build fails, the green “passing” will go to a red “failing.” Shields.io does this by using the variety of APIs available to gather data about builds, code coverage, licenses, chat, sizes and download counts, funding, issue tracking… It’s a lot. But the beauty of it is, you can create Readme files or websites which have easy to read visuals. My PI Monitoring repository‘s Readme makes use of a number of these shields to give you a quick look at the status of the repo.


Posted

in

,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *