目标
我对Azure和pipelines相当陌生,正尝试从Github的pr触发pipeline。
这是pipeline 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)....
Github上的PR看起来像这样:
![enter image description here](https://istack.dev59.com/Pl9fi.webp)
问题
然而,当推送触发器正常工作时,管道并未被触发。
我已经在文档中阅读过,但我不知道为什么这不起作用。
当我通过git push
触发它时,管道运行得非常好。但是,当我尝试使用Github上的PR来触发它时,什么也没发生。在上面的代码中,我尝试关闭推送触发器,并允许所有PR触发管道。但仍然没有反应。
我不想删除管道然后创建新的管道。
更新
我根据下面的建议更新了yaml文件。由于管道现在实际上通过一个推送命令运行,因此yaml文件的其余细节无关紧要,已省略。
我尝试过的其他方法
- 在Github上开启新的PR
- 在Github上关闭/重新打开PR
- 对现有的PR进行更改
-> 仍然没有触发管道。