lapots
lapots

Reputation: 13395

How to add SonarCloud badge on GitHub?

I am trying to add SonarCloud badge to my README.

But when I do like this

![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)

The badge itself looks fine but it does not allow to go to sonarcloud project and instead leads to camo.githubusercontent.com.

Which link should I use to access the SonarCloud project?

Thanks.

Upvotes: 23

Views: 18203

Answers (4)

Vipin
Vipin

Reputation: 5223

As of today, this option is available at the information tab on the sonarcloud, here is ss for my Open source project MSG

SS:

Upvotes: 2

FBH
FBH

Reputation: 793

In new version of sonarcloud.io You will find badges in overview page by clicking in Information button on left bottom enter image description here

Upvotes: 28

Jerry Chong
Jerry Chong

Reputation: 9220

You can use this link to access SonarCloud project directly:

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

Alternatively, you could access your SonarCloud badge via following steps:

  1. Open your SonarCloud project
  2. Click Get project badges button SonarCloud project
  3. Copy the badge link based on your selection on Metric and Format Badge

Upvotes: 31

Flopp
Flopp

Reputation: 1947

The markdown syntax for an image with link is

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

So, try:

[![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)

Upvotes: 12

Related Questions