I have a project on Azure DevOps and within that I have a YAML pipeline.
Given this YAML:
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
# trigger 1
trigger: none
pr:
branches:
include:
- main
pool:
vmImage: ubuntu-latest
steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'
The pipeline is not triggered. My expectations are that this:
It is not triggering when a PR is completed and targets the Main branch. What do I have wrong or what else do I need to check that might prevent the pipeline from being triggered?
The documentation states that you can only use YAML pr
triggers if the git repository is hosted in GitHub or Bitbucket Cloud.
YAML PR triggers are supported only in GitHub and Bitbucket Cloud. If you use Azure Repos Git, you can configure a branch policy for build validation to trigger your build pipeline for validation.
For other repositories such as the default in Azure DevOps, you need to use branch policies.