I have a repo with two subfolders in Visual Studio Team Services: Code and Scripts. I am now triggering one build (BuildScripts) when there's a change in the Scripts folder and another build (BuildCode) when there's a change in the Code folder using the Path Filters on the Triggers tab. If both folders have changed after a push or completed pull request then both builds will be triggered.
What I'd like to do is trigger the BuildCode build if there are changes only in the Code folder. Is there a way to do this?
Azure Devops does support this case. If you are using the following folder structure
📁 rootfolder
|-📁 scripts
|-📁 code
Just create a azure-pipelines.yml
for each path you want to build and add the following lines at the top:
trigger:
paths:
include:
- path/to/include/*
# for exampple:
# - scripts/*
# You can also exlude specific files
exclude:
- docs/README.md
Read more at Microsofts Documentation. An example can be found here.
What I'd like to do is trigger the BuildCode build if there are changes only in the Code folder. Is there a way to do this?
I am afraid there is no such way to do this.
As I understand you, you want trigger the BuildCode
build if there are changes only in the Code folder. That means if both folders have changed after a push or completed pull request, it will not trigger the BuildCode
build. If I understand you correct, you should not have any way to do this.
When we enable the option Enable continuous integration, Azure Devops will trigger build after we submit any change in the branch/folder to ensure that our modifications are correct. This is the original intention of this function being designed.
If both folders have changed but only build one folder, which does not match the original intention of this function. And we could bypass the setting Enable continuous integration for the BuildCode
folder.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With