Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
393 views
in Technique[技术] by (71.8m points)

continuous integration - 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...