简体   繁体   English

仅在 master 上启用合并请求管道

[英]enable merge request pipeline only on master

I am lots of branches in my repo, now I want to add MR pipeline for the master branch, and enable the Merge checks and Pipelines must succeed optional.我的仓库中有很多分支,现在我想为主分支添加 MR 管道,并启用Merge checksPipelines must succeed可选。 unfortunately the repo have so many branches that I don't want to create .gitlab-ci.yml for them one by one.不幸的是,repo 有这么多分支,我不想一一为它们创建.gitlab-ci.yml but as I have enabled the options for merge check, MR to the branched are stuck because they are not passed pipeline(no pipeline is configured for the branch).但是当我启用了合并检查的选项时,分支的 MR 被卡住了,因为它们没有通过管道(没有为分支配置管道)。 So anyone can help me out?所以任何人都可以帮助我吗?

Can you also paste an snipped of your .gitlab-ci.yml file?您还可以粘贴.gitlab-ci.yml文件的片段吗?

Hoping you must have tried this to your stages?希望你一定在你的舞台上尝试过这个?

  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'master'

This basically will run only for a merge request to the master branch.这基本上只会对分支的合并请求运行。 And this chunk should be inside the source branch .gitlab-ci.yml这个块应该在分支.gitlab-ci.yml

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

相关问题 在管道事件源中使用“分支推送”方法计算“仅:更改:” - 合并请求 - Using the "branch push" method of calculate "only: changes:" in pipeline event source - merge-request 接受合并请求后禁用 gitlab 管道 - disable gitlab pipeline after merge request is accepted Gitlab CI 根据合并请求自动运行管道 - Gitlab CI automatical run pipeline on merge request 合并来自不同分支的请求,我是否也需要将 master 合并到它们? - Merge request from different branches, do I need to merge master to them too? 如何让 Gitlab CI 管道始终运行某些作业而仅在合并请求上运行其他作业? - How to have a Gitlab CI Pipeline run some jobs always and other jobs only on merge-requests? 使用 Bash 和 cURL 通过 CI/CD 管道进入时生成 GitLab 合并请求 - Generate GitLab Merge Request when a push comes in via CI/CD Pipeline using Bash and cURL Gitlab上自动合并Master到Development - Automatically merge Master to Develop on Gitlab 在 gitlab 存储库中启用合并选项 - enable the merge option in gitlab repository 在 gitlab ci MR 管道上运行所有作业,即使有些没有 merge_request_event 规则,但不要同时运行 MR 和分支管道 - Run all jobs on a gitlab ci MR pipeline, even if some don't have a merge_request_event rule, but do not run both MR and branch pipelines Gitlab 合并请求何时批准 - Gitlab Merge Request When To Approve
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM