Azure DevOps - Pipeline issues

I’m baffled. I thought I had this working, but it isn’t. I have a pipeline that I would like to run as a pull request build validation requirement. However, it’s running not only for the pull request, but after the pull request (and any other change to main) The YML file does not have any triggers specified, so I am not sure why Azure DevOps is running the pipeline -after- the merge.

Am I misunderstanding the build validation branch policy settings? I feel like I have tried each combination without getting closer to a working process.

Ugh. After disabling the build validation, the pipeline is still executing. It’s as though it has a trigger defined, but I’m not sure where that would be.

Attached snippets showing the YML does not define a trigger, the pipeline UI does not override YML triggers, and the build validation rule is disabled. Yet for some reason, it seems that every commit is causing this pipeline to execute.

When you don’t specify any triggers in the yml, the default is to trigger on every commit.

That’s useful information! I see pr triggers are available in GitHub and BitBucket, but not for Azure DevOps (YML files). If I set the branch policy in the UI for build validation, I would still need to define some sort of trigger rule in the YML so that it doesn’t execute on every commit.

Any ideas on how to run a pipeline only for a pull request? Not for CI and not for push/check-ins.

I think you have to specify your trigger as none and then set the branch policies for PR’s

Perfect. I look forward to trying that this evening.

That worked - thanks!