Shield.IO license badges and Github. License badge not working
Asked Answered
E

3

6

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?

Externality answered 21/1, 2021 at 1:34 Comment(1)
It would be useful to report a bug with an example here: github.com/badges/shields/issuesFreeloader
M
9

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.

Moses answered 29/1, 2021 at 20:19 Comment(0)
M
5

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

Magnificat answered 7/5, 2021 at 8:51 Comment(0)
F
1

I also had the same issue, but I found out that if you use capital letters sometimes it doesn't work. For example, instead of:

![GitHub](https://img.shields.io/github/license/user/MyRepository?style=flat-square)

You should use:

![GitHub](https://img.shields.io/github/license/user/myrepository?style=flat-square)
Flowerage answered 29/3, 2023 at 14:12 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.