2
votes

I've just started using AppVeyor for continuous integration with GitHub. I've been able to add a status badge to my README.md that displays the status of the most recent AppVeyor build. However, I've only been able to display either:

1) The status of the most recent build for a particular branch, say master; or

2) The status of the most recent build for all branches.

I would like to display the status of the most recent build for the branch currently selected in GitHub. For example, if I've selected branch "v0.9" I'd like to see the status of the most recent build for the "v0.9" branch. If I've selected master I'd like to see the status of the most recent build for master.

Is this possible with AppVeyor and GitHub?

2

2 Answers

1
votes

I think that safest option is to add multiple badges as for example done for Cake.MsDeploy

1
votes

It appears this is a common question in Stackoverflow and a common issue in GitHub. The answer is No, it's not possible.

As ilyaf said in his answer the usual workaround is to add multiple build status badges to the README, one for each branch.


References:

GitHub issues:

https://github.com/github/markup/issues/472

https://github.com/github/markup/issues/913

Examples of README.md files with multiple badges:

Get Travis Shield on Github to Reflect Selected Branch Status

https://github.com/cake-contrib/Cake.MsDeploy#cakemsdeploy (from ilyaf's answer)

An example of adding a script to a README.Rmd file to generate the badge URL for the current branch (I'd never heard of a *.Rmd file before; this won't work for everyone):

Get Travis Shield on Github to Reflect Selected Branch Status