4

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?

4

2 回答 2

6

我今天在我的一个存储库中遇到了同样的问题。最后,我通过简单地覆盖许可证徽章的标签来修复它。

前

在此处输入图像描述

这会产生以下网址:

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

在我的示例中,我使用的样式for-the-badge当然是可选的。

还要确保您的存储库包含一个以LICENSE.md所需许可证命名的许可证文件。

于 2021-01-29T20:19:19.710 回答
2

我遇到了同样的问题 - 它没有识别 LICENSE 或 LICENSE.md,其中包含 MIT 许可证。

对于shields.io,我现在只是用

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

执照

于 2021-05-07T08:51:19.207 回答