我将如何使用Travis自动将生成结果更新到Github存储库?

问题描述:

我真正的需求要复杂一些,但我认为这种简化抓住了本质:

My real need is somewhat more complicated, but I think this simplification captures the essence:

我想做的是,在每个GitHub签入中,如果其余的Travis构建成功,就可以从代码(构成主要源代码的JavaScript的精简版)中创建工件.然后,当然,我希望Travis将其签回到GitHub.

What I would like to do is, on every GitHub check-in, if the rest of the Travis build succeeds, to create an artifact from the code (a minified version of the JavaScript that makes up the main source code.) Then of course, I want Travis to check that back into GitHub.

我还没有尝试过,因为我看到了一个紧迫的问题:无限循环.如果Travis将其签入GitHub,那么Travis当然会注意到另一个签入并运行另一个构建,创建另一个工件...

I haven't tried this yet, because I see an immediate problem: an infinite loop. If Travis checks this into GitHub, then of course Travis would notice another check-in and run another build, create another artifact...

我如何最好避免这种情况?

How could I best avoid this?

Travis将忽略其消息包含 [ci skip] 的所有提交,因此,当您从travis提交缩小的脚本时,请确保消息的一部分.如果您需要更多帮助,我们很乐意提供一些代码示例.

Travis will ignore all commits whose message contains [ci skip], so when you commit the minified scripts from travis make sure that is part of the message. If you need any more help I'd be happy to give some code examples.