如何在 GitHub 上添加 SonarCloud 徽章?

How to add SonarCloud badge on GitHub?

我正在尝试将 SonarCloud 徽章添加到我的 README

但是当我这样做的时候

![https://sonarcloud.io/dashboard?id=com.lapots.breed.judge%3Ajudge-rule-engine](https://sonarcloud.io/api/project_badges/measure?project=com.lapots.breed.judge%3Ajudge-rule-engine&metric=alert_status)

徽章本身看起来不错,但它不允许转到 sonarcloud 项目,而是指向 camo.githubusercontent.com

我应该使用哪个 link 来访问 SonarCloud 项目?

谢谢。

带有link的图像的降价语法是

[![<image title>](<image url>)](link url)

所以,尝试:

[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=com.lapots.breed.judge:judge-rule-engine&metric=alert_status)](https://sonarcloud.io/dashboard?id=com.lapots.breed.judge:judge-rule-engine)

您可以使用此 link 直接访问 SonarCloud 项目:

https://sonarcloud.io/dashboard?id=Project_Key_Here

或者,您可以通过以下步骤访问您的 SonarCloud 徽章:

  1. 打开您的 SonarCloud 项目
  2. 单击获取项目徽章按钮
  3. 根据您在 MetricFormat 上的选择复制徽章 link

在 sonarcloud.io 的新版本中 您可以通过单击左下角的信息按钮在概览页面中找到徽章