gpt4 book ai didi

Azure DevOps 构建管道 : CI triggers not working on PR merge to a branch when there is no work item is attached with the PR

转载 作者:行者123 更新时间:2023-12-03 06:30:02 26 4
gpt4 key购买 nike

当对 my_branch 进行任何更改(直接更改分支或通过合并 PR)时,我需要触发管道(CI),我的 yml 触发器配置如下 -

trigger:
batch: true
branches:
include:
- my_branch
paths:
include:
- path/of/the/directory

如果工作项附加有 PR 并且 PR 与 my_branch 合并,则此方法可以正常工作。

但是,当 PR 没有附加工作项时 - CI 在合并 PR 后不会触发。

我错过了什么吗?

最佳答案

我尝试在我的环境中重现相同的结果,并成功获得如下结果:

 第 1 步:创建示例存储库。 (现阶段没有应用任何分支机构政策)

第 2 步:创建基本的 yaml 构建管道,如下所示。

trigger:
branches:
batch: true
include:
- main
pool:
vmImage: ubuntu-latest
steps:
- script: echo Hello, world!
displayName: 'Sample script'

第3步:从主分支创建一个新分支。

enter image description here enter image description here

第 4 步:修改或添加一些代码到新创建的分支,并向主分支创建拉取请求并验证构建管道。

enter image description here enter image description here enter image description here enter image description here

注意:由于我没有在主分支上设置任何拉取请求策略,因此只有在功能分支合并到主分支后才会触发构建管道。

关于Azure DevOps 构建管道 : CI triggers not working on PR merge to a branch when there is no work item is attached with the PR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75298608/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com