Last week a colleague complained to me that he had to wait for an available build agent on our Azure DevOps build server. The reason that all build agents were busy was because I was doing a lot of changes to the documentation(also stored in an Azure DevOps Git repository) causing a lot of builds to be triggered resulting in long wait queues.
As only changing the markdown files in the wiki doesn’t need a build to be created, he asked me to configure the build trigger to ignore documentation changes.
Let me show you how to configure this…
Classic Pipelines
To configure this for the ‘classic’ pipelines in Azure DevOps, you need to go to the Triggers tab for your pipeline. There you’ll find a Path filters section on the right where you can specify specific paths to include or exclude.
In our example, we want to exclude everything inside the ‘SOFACore/Docs’ folder:
YAML Pipelines
If you are using a YAML pipeline, you need to edit the trigger section and add a path exclude there:
That’s it!
More information
Build Azure Repos Git repositories - Azure Pipelines | Microsoft Learn