badges / badges/shields

Sonarcloud badges do not work for private repositories

Open
#10,557 4 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
27.2k
Forks
5.6k
Avg merge
1d 8h
Merged PRs (30d)
46

Description

### Are you experiencing an issue with...

shields.io

### 🐞 Description

SonarQube / SonarCloud badges for private repositories need a token, [similar to CircleCI](https://github.com/badges/shields/blob/b9955143dbc6f50e9389cbcaa82460a6cb1dadef/services/circleci/circleci.service.js#L49-L53).

For Sonar badges, this token cannot be configured though, making them unusable for private repos.

It seems there is support in the code, but it uses statically configured auth:
https://github.com/badges/shields/blob/b9955143dbc6f50e9389cbcaa82460a6cb1dadef/services/sonar/sonar-base.js#L53

### 🔗 Link to the badge

_No response_

### 💡 Possible Solution

Add a `token` option to the Sonar badges.

Contributor guide

Open the contributing guide

Research direction

Start by comparing services/sonar/sonar-base.js at the referenced authentication code with the token handling in services/circleci/circleci.service.js. Trace how Sonar badge options are passed into the service, then verify that a configurable token is accepted and private-repository badges can authenticate successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.