I've set up a pipeline to trigger on a PR - but they're not triggering when I commit to the PR branch, or open a PR. I'm not sure where the pr key is meant to go either.
This is the yml file that I'm working on. Is this the right syntax?
https://github.com/hjfitz/spoticli/blob/feature/pr-pipelines/.pipelines/pr.yml
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Thanks for your question. It looks like you're working through an issue with your scenario or implementation, rather than an issue with the documentation. Here are a couple of options where you might consider asking your question:
Hey - I'm working through an issue due to the documentation - I've set my file up according to the documentation, but the expected outcome differs from what the documentation would suggest.
@hjfitz -- Harry, thank you for the clarification. We are looking into your issue.
@hjfitz I can't see your YAML file, can you paste in the pr trigger parts here? The triggers should go in the azure-pipelines.yml, unless you have explicitly configured your pipeline to use another file with a different name.
A common reason the YAML triggers don't fire is that they are overridden in the Pipeline settings, documented here
It is possible that your Azure DevOps Services organization has gone dormant, we are preparing a new topic to explain more details of this, but if you haven't signed in to your Azure DevOps Services account and viewed any pages on the web portal, that may be a reason why your triggers aren't getting picked up. If you have signed in recently to the Azure DevOps Services portal, it probably isn't this.
Also, for pr triggers, the YAML file with the PR trigger must be part of the target branch already. For example if your PR trigger is configured on the master branch, that trigger in the YAML file must already be configured there.
More details on triggering Pipelines from GitHub here
I wasn't able to see the pipeline in your link above but I was able to see this folder:
https://github.com/hjfitz/spoticli/tree/master/.pipelines
I see some of the yml files have PR triggers but I didn't see any in azure-pipelines.yml.
Please check these (and also from the next comment) and see if one of these resolves your issue?
@hjfitz I was able to see this file in the master branch:
https://github.com/hjfitz/spoticli/blob/master/.pipelines/pr.yml
pr:
- master
- feature/*
- cleanup/*
- fix/*
This looks right to me, if the pr.yml is the file you have configured in your Pipeline (click Edit on the pipeline and you can see the file there, here is a screenshot from one of my test pipelines)

If you click Settings:

You can change the YAML file for the pipeline:

Hey @steved0x, thank you for the detailed reply!
I think that the setting was switched off on DevOps... My bad 😬. The article you posted about that is really useful - thank you!
I just had one last question that the docs didn't cover - if that's alright. When setting up a PR trigger, do I also need trigger: none in the config? Similarly, if I'm setting up a push trigger, do I need pr: none?
Again, I really appreciate the help. Thank you!
@hjfitz You can use both trigger and pr in the same pipeline and on the same branch (although you may get some duplicate builds), so you don't need to set none for either type, unless you specifically don't want any of that type of trigger)
My pleasure and I'll see if I can't add some more crosslinking from the triggers topic to the specialized topics that cover triggers on GitHub and Azure Repos.
Makes sense. Thank you for all your help!
Most helpful comment
@hjfitz You can use both
triggerandprin the same pipeline and on the same branch (although you may get some duplicate builds), so you don't need to setnonefor either type, unless you specifically don't want any of that type of trigger)My pleasure and I'll see if I can't add some more crosslinking from the triggers topic to the specialized topics that cover triggers on GitHub and Azure Repos.