Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shield.IO license badges and Github. License badge not working

I have created an MIT license in Github for my project. It added a license file and now shows up as an MIT license.

I went to Shields.IO and it suggested links to my repo. One of which is the license badge.

I have added this to my read me using markup and all other badges work except the license badge.

I have also allowed shields requests to my Github by it requesting privilleges.

Is there anything else I have to do to get this to work?

I assumed Shields reads Github's license file inside the repo to get the type of license?

like image 595
lizard Avatar asked Jan 24 '23 12:01

lizard


2 Answers

I had the same issue today in one of my repositories. At the end I fixed it by simply overriding the label of the license badge.

Before

before

After

enter image description here

This produces the following url:

https://img.shields.io/github/license/your-name/your-repository?label=license&style=for-the-badge

In my example I'm using the style for-the-badge which is optional of course.

Also make sure, that your repository contains a license file named LICENSE.md with the desired license.

like image 130
Daniel Bubenheim Avatar answered Jan 27 '23 06:01

Daniel Bubenheim


I had the same issue - it wasn't recognizing LICENSE or LICENSE.md with an MIT license in it.

For shields.io, I just overrode it for now with

[![License](https://img.shields.io/badge/license-MIT-green)](./LICENSE)

License

like image 39
Brian Burns Avatar answered Jan 27 '23 06:01

Brian Burns