Home > database >  How can i trigger a build in Azure DevOpswhen a pull request is made in Github
How can i trigger a build in Azure DevOpswhen a pull request is made in Github

Time:05-25

I'm using Azure DevOps for pipelines and GitHub as my repo. I want to trigger a build in Azure DevOps when a pull request is made.

I have two branches in GitHub: master and test.

When I update test and create a pull request I want Azure DevOps to automatically build the pipeline and run it... how can i do this ?

I tried the below but nothing happens

pr:

  • main

trigger:

  • main

pool: vmImage: ubuntu-latest

CodePudding user response:

You can add a pr trigger in your yaml pipeline:

pr:
- master

CodePudding user response:

this worked for me in the end :

**pr:
  branches:
    include:
    - '*'** 
pool:
  vmImage: ubuntu-latest

steps:
- script: echo Hello, world!
  displayName: 'Run a one-line script'
  • Related