在排除文件夹中,Azure Pipeline被修改触发
我有一个包含 2 个项目的多项目存储库。我每个项目都有一个管道,其中包含另一个项目定义的排除路径。每当我对任何文件进行更改时,两个管道都会被触发。
.
├── README.md
└── project-1
|── azure-pipelines-apis.yml
│ └── …
└── project-2
|── azure-pipelines-ui.yml
└── …
└── project-3
└── project-4
以下是管道:
Project-1:
trigger:
branches:
include:
- 'dev'
paths:
include:
- 'project-1/*'
exclude:
- 'project-2/*'
- 'project-3/*'
- 'project-4/*'
- 'README.md'
Project-2:
trigger:
branches:
include:
- 'dev'
paths:
include:
- 'project-2/*'
exclude:
- 'project-1/*'
- 'project-3/*'
- 'project-4/*'
- 'README.md'
每当我在 project-1 内推送文件更改时,两个管道都会运行。我尝试在 Azure Devops Pipelines 上的触发器菜单内定义包含和排除路径,但没有成功。
你能给我任何线索来查明发生了什么事吗?我已按照官方文档进行操作,但我找不到发生了什么。
谢谢!
I have a multiproject repo with 2 projects. I have a pipeline in each one with the exclude path defined with the other project. Anytime I push a change on any file, both pipelines are being triggered.
.
├── README.md
└── project-1
|── azure-pipelines-apis.yml
│ └── …
└── project-2
|── azure-pipelines-ui.yml
└── …
└── project-3
└── project-4
And here are the pipelines:
Project-1:
trigger:
branches:
include:
- 'dev'
paths:
include:
- 'project-1/*'
exclude:
- 'project-2/*'
- 'project-3/*'
- 'project-4/*'
- 'README.md'
Project-2:
trigger:
branches:
include:
- 'dev'
paths:
include:
- 'project-2/*'
exclude:
- 'project-1/*'
- 'project-3/*'
- 'project-4/*'
- 'README.md'
Anytime I push a change in a file inside project-1, both pipelines run. I tried to define the include and exclude paths inside the triggers menu on Azure Devops Pipelines but didn't work.
Could you give me any clue to find what's going on? I've followed the official documentation but I can't find what is happening.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的 YAML 触发器看起来不错。您也不需要添加排除部分,因为它们是不同的路径。您能否检查一下 Azure DevOps 上分配的 YAML 文件?
Your YAML triggers seem fine. You don't need to add the exclude part also since they are different paths. Could you please check the assigned YAML file on the Azure DevOps?
下面的代码对我有用。因此,第二管道被排除在外。
项目1:
Code below worked for me. So the second pipeline is explicite excluded.
Project-1: