PR triggers on any commit

%3CLINGO-SUB%20id%3D%22lingo-sub-2588480%22%20slang%3D%22en-US%22%3EPR%20triggers%20on%20any%20commit%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2588480%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20all%2C%3C%2FP%3E%3CP%3EI'm%20working%20on%20an%20Azure%20DevOps%20pipeline%20that%20I%20would%20like%20to%20fire%20ONLY%20when%20a%20pull%20request%20is%20issued%20targeting%20the%20main%20branch.%20The%20repo%20is%20sitting%20on%20GitHub.%20My%20yaml%20looks%20like%20this%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-yaml%22%3E%3CCODE%3Epr%3A%0A%20%20branches%3A%0A%20%20%20%20include%3A%0A%20%20%20%20-%20main%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EI%20created%20a%20new%20branch%20called%20pr-test-1%20from%20main.%20Made%20a%20few%20changes%20to%20my%20local%20copy%20and%20pushed%20the%20new%20branch%20to%20the%20GitHub%20repo.%20This%20triggered%20the%20pipeline%20even%20though%20I%20had%20not%20created%20a%20PR%20for%20pr-test-1.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20changing%20the%20include%20to%20an%20exclude%2C%20but%20that%20did%20not%20fix%20it.%20Am%20I%20completely%20misunderstanding%20how%20the%20pr%20trigger%20is%20meant%20to%20work%3F%20Or%20is%20there%20something%20I%20need%20to%20change%20on%20my%20GitHub%20repo%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20any%20help!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Regular Visitor

Hey all,

I'm working on an Azure DevOps pipeline that I would like to fire ONLY when a pull request is issued targeting the main branch. The repo is sitting on GitHub. My yaml looks like this:

pr:
  branches:
    include:
    - main

I created a new branch called pr-test-1 from main. Made a few changes to my local copy and pushed the new branch to the GitHub repo. This triggered the pipeline even though I had not created a PR for pr-test-1.

 

I tried changing the include to an exclude, but that did not fix it. Am I completely misunderstanding how the pr trigger is meant to work? Or is there something I need to change on my GitHub repo?

 

Thanks for any help!

0 Replies