在排除文件夹中,Azure Pipeline被修改触发

发布于 2025-01-20 20:39:02 字数 901 浏览 0 评论 0原文

我有一个包含 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

四叶草在未来唯美盛开 2025-01-27 20:39:02

您的 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?

紫罗兰の梦幻 2025-01-27 20:39:02

下面的代码对我有用。因此,第二管道被排除在外。

项目1:

trigger:
  branches:
    include:
      - 'dev'
  paths:
    include:
      - 'project-1/*'
    exclude:
      - project-2/azure-pipelines-ui.yml

Code below worked for me. So the second pipeline is explicite excluded.

Project-1:

trigger:
  branches:
    include:
      - 'dev'
  paths:
    include:
      - 'project-1/*'
    exclude:
      - project-2/azure-pipelines-ui.yml
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文