禁用Gitlab中每个提交的管道,仅在打开合并请求时运行它

编程入门 行业动态 更新时间:2024-10-28 14:31:30
本文介绍了禁用Gitlab中每个提交的管道,仅在打开合并请求时运行它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

CI管道在我工作的Gitlab存储库中的每次提交上运行.有没有办法禁用它,并且仅在对master分支的打开合并请求上运行CI管道?

The CI pipeline runs on every commit in my Gitlab repository at work. Is there way to disable that and only run the CI pipeline on an open merge request to the master branch?

感谢您的帮助.谢谢.

推荐答案

当前没有配置选项可以执行此操作.这里有一些可以用来禁用"管道构建的东西.

There is currently no configuration option to do that. Here are some things that can be used to "disable" a pipeline build.

  • 在提交消息中添加 [ci skip] 不会触发推送管道.
  • 在管道中的所有作业上
  • 使用 except 和 only 选项.为避免这种情况下的重复,您可以使用锚点.
  • Adding [ci skip] inside the commit message will not trigger a pipeline on push.
  • Using except and only options on all jobs inside the pipeline. To avoid duplication in this case, you can use Anchors.

更新:GitLab 11.7

当推送到GitLab时,您可以通过将ci.skip选项传递给push命令来跳过触发管道的操作: git push -o ci.skip

When pushing to GitLab you can skip triggering a pipeline by passing ci.skip option to the push command: git push -o ci.skip

更多推荐

禁用Gitlab中每个提交的管道,仅在打开合并请求时运行它

本文发布于:2023-10-24 09:59:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1523647.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:时运   管道   Gitlab

发布评论

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

>www.elefans.com

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