简体   繁体   中英

github badges and branches

Does anyone know of a good way to display badges for Travis CI, etc. on the main page of a Github repo without keeping them in version control?

I like to have the badges on the front page, but if they're committed in the README then every branch & fork references the badges from master. It'd be better to have no badges on the development branches than incorrect ones.

We're lazy and just put a table in markdown that shows separate badges for master and develop

在此输入图像描述

No need to worry about merging blips then

I like to have the badges on the front page, but if they're committed in the README then every branch & fork references the badges from master.

This is only true if the README for every branch & fork references the same badge. If you want each branch to show it's status simply update the README for the branches.

Assuming when you say I like to have the badges on the front page you mean within the README of the default branch in github: You can do this by simply editing the README in your default branch with a list of status badges. All of this is just source control management and leveraging the fact that github renders markdown: You can't really script anything within github itself. It's conceivable that you could automate this for dynamic branches using git hooks , but I'm unaware of anybody who's done this.

In your readme link them using markdown to generate the buttons. Travis CI and code climate provide premade buttons to use in your readme. For other services you can make your own in the same format with shields.io (I don't believe they are dynamic but you can update them manually)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM