badges / gh-badges

Go to badges/shields. Especially if you don't know why. (This repo is old.)
http://img.shields.io/
Creative Commons Zero v1.0 Universal
86 stars 29 forks source link

Specify the branch for service images. #24

Closed jmalloc closed 10 years ago

jmalloc commented 10 years ago

It would be awesome if the branch name could be specified for Coveralls and Travis images - assuming this isn't already possible? :)

mathiasbynens commented 10 years ago

More info: for Travis, the URL format looks like:

https://travis-ci.org/mathiasbynens/jsesc.png?branch=master

gh-badges doesn’t support this yet AFAICT but it’s definitely possible to add support for this. Wanna submit a patch? :)

espadrine commented 10 years ago

The current Travis URL is: http://b.adge.me/travis/<USER/REPO>.svg.

@jmalloc Tell me what you'd find nice. http://b.adge.me/travis/<USER/REPO/BRANCH>.svg, maybe?

jmalloc commented 10 years ago

For reference the Coveralls URL is much the same:

https://coveralls.io/repos/recoilphp/recoil/badge.png?branch=develop

I'll give a patch a go, sure :)

@espadrine I like your example yes! As a personal preference I like including the branch in the path rather than the query parameters.

espadrine commented 10 years ago

@jmalloc If you want to give it a go, I advise you to change line 11 in server.js so that what we take takes slashes into account, ie, ([^/]+) instead of (.*) in the regexp.

Krinkle commented 10 years ago

Branch names can contain slashes though. Implementing it as a query parameter here, too, might not be a bad idea.

espadrine commented 10 years ago

@Krinkle I was thinking more like ([^/]+)/([^/]+)/(.+), as in, no slash in the name and repo, but you can have a slash in the branch name.

espadrine commented 10 years ago

Done with #25.