Jenkins Job无法生成合并请求
我们的团队正在开发一个 Jenkins 作业,当我们将开发分支合并到存储库中的发布分支时,我们可以使用它创建合并/拉取请求。此作业将同时为 32 个存储库执行此任务,因为所有存储库都具有相同的分支名称。版本控制是gitlab。
现在,我在 Jenkins Build Step > 中使用以下命令:执行 Shell 创建合并请求。
git push -v --push-option='merge_request.create' origin ${SourceBranch}:${TargetBranch}
现在不再创建合并请求,而是直接合并两个分支。
请帮我解决这个问题。
提前致谢。
Our team is developing a Jenkins job using which we can create Merge/Pull request when we are merge dev branch to release branch in our repo. This job will do this task for 32 repos at once as all repos have same branch names. Version control is gitlab.
Now, I am using following command in Jenkins Build Step > Execute Shell to create merge request.
git push -v --push-option='merge_request.create' origin ${SourceBranch}:${TargetBranch}
Now Instead of creating Merge request, it is directly merging the two branches.
Please help me to solve this problem.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这会将您的源分支推向远程目标分支,这不是您想要的。
要获取所需的行为(创建从源到目标的MR)推到源分支并使用
merge_request.target
选项,以指定MR的目标分支。这将推向源分支,并创建从源分支到目标分支的MR。
This will push your source branch to the remote target branch, which is not what you want.
To get the behavior you want (creating an MR from source to target) push to the source branch and use the
merge_request.target
option to specify the target branch for the MR.This will push to the source branch and create an MR from the source branch to the target branch.