This seems a little outdated, VSTS options for branch policiy PR validation have extended to include a 'Path Filter'
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
In the meantime does anyone have an example of how to only exclude a particular directory?
!/Test
to exclude the Test Directory
That does not seem to work.
To cite the tooltip:
If a path filter is set, the policy will only apply when files which match the filter are changed. Leaving this field blank means that the policy will always apply.
You can specify absolute paths and wildcards
Example: /WebApp/Models/Data.cs, /WebApp/*, or *.csYou can specify multiple paths using ";" as a separator
Example:
/WebApp/Models/Data.cs;ClientApp/Models/Data.csPaths prefixed with "!" are excluded
Example: /WebApp/;!/WebApp/Tests/Order is significant
How do I ignore a single file?
*;!README.md does not work.
/*;!README.md does not work.
/*;!/README.md worked.
I found a comment on an issue that appears to solve the problem:
Your first example is not going to work because if you apply a filter, we automatically exclude all files. [...] you aren't including anything, so that is why nothing runs.
You have to include everything, and then exclude the files/folders you don't want. This isn't clear from the tooltip.