mikemaccana
mikemaccana

Reputation: 123540

Is it possible to have a CI badge for a private repo on GitHub?

I have a private repository, that uses CircleCI. I can make a badge reflecting the tests passing/failing in the README.md with something like:

<img src="https://circleci.com/gh/mikemaccana/someapp.svg?style=shield"/>

(the markdown equivalent also works).

However looking on the published page on github.com, GitHub seems to convert this URL to something like:

https://camo.githubusercontent.com/verylongstringofcharacters

Is it possible to have a CI status badge for a private repo?

I'd be OK with changing Circle permission to make the test status publicly available if that was a solution.

Upvotes: 5

Views: 6085

Answers (1)

mikemaccana
mikemaccana

Reputation: 123540

A few hours later I found the answer - see Creating Badges for Private Repositories

Create a status API token, go to your Project’s Settings (present on the top right corner) > API Permissions and create a token scoped to Status.

Include the token in the badge code:

[![CircleCI](https://circleci.com/<VCS>/<ORG_NAME>/<PROJECT_NAME>.svg?style=svg&circle-token=<YOUR_STATUS_API_TOKEN>)](<LINK>)

Upvotes: 7

Related Questions