简体   繁体   English

在 GitLab 管道中,有没有办法在分离合并请求时运行管道?

[英]In GitLab Pipelines is there a way to run a pipeline when a Merge Request is detached?

I am trying to run a pipeline when a merge request in gitlab is detach means that is not a success and is rejected or closed without merging into the branch.我试图在 gitlab 中的合并请求分离时运行管道,这意味着不成功并且在没有合并到分支的情况下被拒绝或关闭。 So is it possible to execute it only for CI_MERGE_REQUEST_EVENT_TYPE=detach as we execute for particular branches?那么当我们为特定分支执行时,是否可以只为 CI_MERGE_REQUEST_EVENT_TYPE=detach 执行它?

You should be able to use only: with the variables: option.您应该只能使用only:variables:选项。 I ditn't test this, but please try adding this a job:我没有对此进行测试,但请尝试将其添加到作业中:

only:
  variables:
    - $CI_MERGE_REQUEST_EVENT_TYPE == "detach"

See the documentation for more details: https://docs.gitlab.com/ee/ci/yaml/README.html#onlyvariablesexceptvariables有关更多详细信息,请参阅文档: https : //docs.gitlab.com/ee/ci/yaml/README.html#onlyvariablesexceptvariables

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM