Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

PR Trigger Not Working on Azure DevOps YAML Pipeline

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:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

  • will not trigger when a PR is created, approved
  • will trigger when a PR is approved when the PR is targeting the Main branch

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?

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading