Azure DevOps:除主分支之外的所有分支的管道

发布于 2025-01-20 05:39:15 字数 633 浏览 2 评论 0原文

我有一个带有两个管道的网站项目

1.- PROD 管道,它在每次主分支推送时触发。这将构建网站、部署网站并向整个公司发送电子邮件,通知新版本。到目前为止,这工作得很好 ✅

2.- DEV pipeline:应该在推送到任何非主分支时触发。构建站点,将站点部署到 DEV 阶段并向提交的作者发送电子邮件。

按照文档,此触发器配置应触发除主分支之外的所有分支上的 DEV 管道。

trigger:
  branches:
    exclude:
      - master
    include:
      - '*'

但是,如果我随后尝试在非主分支的任何分支中运行管道,则会收到以下错误:遇到错误:无法找到此分支/标签的有效管道 YAML 文件

Azure DevOps 管道:遇到错误:找不到此分支/标签的有效管道 YAML 文件

如何设置管道,以便它被除主分支之外的所有分支触发?

预先感谢您的帮助!

D

I have a website project with two pipelines

1.- PROD pipeline, which is triggered on every master branch push. This builds the site, deploys it and sends an email to the whole company informing about the new version. This works perfectly so far ✅

2.- DEV pipeline: should be triggered on a push to ANY branch that is not master. Builds the site, deploys the site to a DEV stage and sends an email to the author of the commit.

Following the docs, this trigger configuration should trigger the DEV pipeline on all branches but master.

trigger:
  branches:
    exclude:
      - master
    include:
      - '*'

However, if I then try run the pipeline in any branch that is not master, I get the following error: Encountered error(s): Could not find valid pipeline YAML file for this branch/tag

Azure DevOps pipelines: Encountered error(s): Could not find valid pipeline YAML file for this branch/tag

How can I setup the pipeline, so that it gets triggered by all branches but the master branch?

Thanks in advance for your help!

D

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

巴黎盛开的樱花 2025-01-27 05:39:15

您必须在要触发的每个分支中都有yaml文件,而不能仅仅将其放在主分支中,并期望它在另一个分支上触发。

You have to have the YAML file in every branch you want it to trigger for, you cannot just have it in the master branch and expect it to trigger on another branch.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文