I am using the yaml pipelines in Azure DevOps Pipelines and I see they have two specific trigger keys trigger
and pr
.
I want it setup so that a few pipelines I have to run tests and security checks only run when a PR on a feature branch or bugfix branch is created (or appended to) but not when they are just pushing to a feature or bugfix branch that does not have a PR yet.
Here is what I have for the pr
key:
pr:
branches:
include:
- bugfix/*
- feature/*
paths:
include:
- Source/Frontend/*
This is for a js frontend pipeline that runs tests, linting, and coverage so I have it limited to only changes to the folder that contains the frontend code.
What do I set the trigger
key to in order to accomplish the above stated goal?
I have tried leaving it as default by excluding a trigger
key in my yaml file, but that just picks up every commit in any folder. I have also tried trigger: none
but that seems to stop it from running at all. And I have also tried have the trigger
key be the same as the pr
key, but when I make a PR, it is not fired off.
I have ensured that the trigger overrides in Azure DevOps are turned off, so it should be going off of whatever is in the yaml.