在GitHub repo中显示Travis构建状态(Showing Travis build status in GitHub repo)

编程入门 行业动态 更新时间:2024-10-28 03:28:44
在GitHub repo中显示Travis构建状态(Showing Travis build status in GitHub repo)

我记得最近在GitHub中看到Travis建立状态,或者在GitHub中浏览存储库(但找不到位置)。 我不是在README.md的Travis构建状态图像,而是一个实际的GitHub功能(带有友好的复选标记的绿色框)。

虽然我的承诺建立在Travis上很好,我想把结果显示在GitHub(他们现在不做)。 我想知道如何启用此功能。

UPDATE

在这里找到一个例子: https : //github.com/sebastianbergmann/phpunit/pull/1051/commits看到一个小的绿色复选标记,“Travis-CI建立通过”?

I remember recently seeing the Travis build status of a pr or commit in GitHub browsing the repository (but can't find where). I'm not talking about the Travis build status images in README.md but an actual GitHub feature (green box with a friendly check mark).

While my commits build on Travis just fine I'd like to get the results displayed in GitHub (which they don't do right now). I'd like to know how to enable this.

UPDATE

Found an example here - see the small green check mark saying "Travis-CI build passed"?

最满意答案

我给你我的例子 - https://github.com/simkimsia/UtilityBehaviors

我在我的README.mdown中写道

### Status [![Build Status](https://travis-ci.org/simkimsia/UtilityBehaviors.png)](https://travis-ci.org/simkimsia/UtilityBehaviors)

所以答案是

[![Build Status](your travis url for the repo here.png)](your travis url for the repo here)

编辑:

我意识到你可能会打开Travis服务钩。

如果这是你的意思,去你的github回购>设置>服务挂钩。 使用Ctrl + F并搜索Travis。

EDIT2:

转到https://travis-ci.org/profile/ {填写您自己的usernam} /个人资料

然后复制令牌并将其粘贴到您的Github Repo设置部分的Travis服务钩子页面中。

在Travis中输入您的用户名。

尝试测试发送令牌按钮。

你应该看到有效载荷成功发送。

如果这样工作,你的github回购现在已经挂上你的travis了。

EDIT3:

OP要求关于在拉请求页面中发现的提交的travis构建状态。

他假设travis构建状态将显示在任何地方,只要有提交。

我的答案是假设是不正确的。

I give you my example - https://github.com/simkimsia/UtilityBehaviors

I wrote this in my README.mdown

### Status [![Build Status](https://travis-ci.org/simkimsia/UtilityBehaviors.png)](https://travis-ci.org/simkimsia/UtilityBehaviors)

So the answer is

[![Build Status](your travis url for the repo here.png)](your travis url for the repo here)

EDIT:

I realized that you may mean turning on the Travis Service Hook.

If that is what you mean, go to your github repo > Settings > Service Hooks. Use Ctrl+F and search for Travis.

EDIT2:

Go to https://travis-ci.org/profile/{fill in your own usernam}/profile

Then copy the token and paste it inside the Travis Service Hook page in your Github Repo Settings section.

Type in your username in Travis as well.

Try the test send token button.

You should see payload successfully sent.

If this works, your github repo is now hooked up to your travis.

EDIT3:

The OP is asking about the travis build status for commits found in pull requests pages.

He assumed that the travis build status will appear anywhere as long as there is a commit.

My answer is that the assumption is not correct.

更多推荐

本文发布于:2023-07-31 01:29:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1340411.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:状态   Travis   repo   GitHub   build

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!