在Github上获取Travis Shield来反映选定的分支状态 [英] Get Travis Shield on Github to Reflect Selected Branch Status

查看:202
本文介绍了在Github上获取Travis Shield来反映选定的分支状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我可以让我的Travis Shield反映最新的运行或特定的分支,而不管我在我的github项目页面中选择哪个分支。我可以通过忽略或在URL末尾指定分支名称来完成此操作。相反,我想获得与所选分支对应的屏蔽。换句话说,每次我选择一个不同的分支时,我的 README.md 文件中的travis shield的URL都会改变。



在SVN中,您可以使用SVN关键字通过修改带有分支名称的盾牌URL(或类似的东西)来实现此类排序。这个
发行版:

dev:


Right now I can get my travis shield to either reflect the latest run, or a specific branch, irrespective of what branch I select in my github project page. I can do this by either leaving out or specifying the branch name at the end of the URL. Instead, I would like to get the shield corresponding to the selected branch. In other words, each time I select a different branch, the URL to the travis shield in my README.md file would change.

In SVN you could use SVN keywords to implement something of the sort by modifying the shield URL with the branch name (or something like it). This QA provides some alternatives for git, but:

  • I'd prefer to avoid relying on shell scripts
  • I don't think keyword expansion will work because I need the files to be different on the Github side, not on my local computer (hopefully I'm just wrong about this)

Any ideas? Hopefully I'm just missing something silly. Feels like there has to be a really easy way of doing this.

解决方案

I make use of Travis build shields for miniCRAN, and the solution is quite simple.

Note the addition of ?branch=... at the end of each travis shield link.

Here is an extract from the README.md:

**Build status**

master: 
[![Build Status](https://travis-ci.org/andrie/miniCRAN.svg?branch=master)](https://travis-ci.org/andrie/miniCRAN)
release:
[![Build Status](https://travis-ci.org/andrie/miniCRAN.svg?branch=release)](https://travis-ci.org/andrie/miniCRAN)
dev: [![Build Status](https://travis-ci.org/andrie/miniCRAN.svg?branch=dev)](https://travis-ci.org/andrie/miniCRAN)

This results in:

Build status

master: release: dev:

这篇关于在Github上获取Travis Shield来反映选定的分支状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆