Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Link badge to branch build history

Tags:

travis-ci

When I'm looking for a badge with status for given branch I'm using branch parameter in URL. I'd like to do the same with the link to the latest build or build history of a given branch.

If this is not possible currently I'd be more than happy having such feature provided.

like image 984
Michał Chmielarz Avatar asked Feb 11 '15 13:02

Michał Chmielarz


People also ask

How do I add a badge to a readme file?

Click on the badge to fill in required data elements for that badge type (like your username or repo) and optionally customize (label, colors etc.). And it's ready for use! Use the button at the bottom to copy your badge url or snippet, which can then be added to places like your GitHub readme files or other web pages.

How do I add a status badge to GitHub?

To add a workflow status badge to your README.md file, first find the URL for the status badge you would like to display. Then you can use Markdown to display the badge as an image in your README.md file. For more information about image markup in Markdown, see "Basic writing and formatting syntax."

What are Git badges?

GitHub Badges can boost the readability of the GitHub repositories because they provide users with a fast way to capture repository metrics. Badges are supposed to be embedded in your README.md which elucidates the importance and necessity of your project to other developers.


2 Answers

Travis doesn't seem to currently implement this.

There is an open issue requesting such a feature though:
https://github.com/travis-ci/travis-ci/issues/1996

like image 175
cvrebert Avatar answered Oct 12 '22 15:10

cvrebert


If you need URL, the only workaround is to point to:

https://travis-ci.org/{owner_name}/{repo_name}/branches

which would list all branch build history.

Otherwise access to branch build history this can be achieved via Travis CI API in JSON format (as discussed in GH #1996), so it's:

https://api.travis-ci.org//v3/repo/{repository.id}/branch/{branch.name}

To find your repository.id, see: What is the “repository ID” discussed in the Travis-CI API?

like image 25
kenorb Avatar answered Oct 12 '22 14:10

kenorb