我对Azure和管道非常陌生,并且我想从Azure中的公关触发管道。该回购协议位于Github中。
这是管道yaml:pipeline.yml
trigger: none # I turned this off for to stop push triggers (but they work fine)
pr:
branches:
include:
- "*" # This does not trigger the pipeline
stages:
- stage: EchoTriggerStage
displayName: Echoing trigger reason
jobs:
- job: A
steps:
- script: echo 'Build reason::::' $(Build.Reason)
displayName: The build reason
# ... some more stages here triggered by PullRequests....
# ... some more stages here triggered by push (CI)....
但是,当推式触发器可以正常工作时,不会触发管道。
我已经阅读了文档,但看不到为什么这不起作用。
当我通过触发时,管道运行正常git push
。但是,当我尝试用Github的PR触发它时,什么也没发生。在上面的代码中,我尝试关闭推式触发器,并允许所有PR触发管道。依然没有。
我还不想删除管道并创建一个新管道。
我更新了yaml文件,使其按照下面的建议工作。由于管道现在实际上是通过push命令运行的,因此yaml文件的其余详细信息无关紧要,因此被忽略了。
->仍然不会触发管道。
解决方案是转到Azure管道->编辑管道->触发器->启用PR验证。