What is the correct way to exclude yaml files from adding specific reviewers?

Viewed 37

I've setup 4 branch policies but only 1 appears to be working properly. I've got 1 policy that uses the path filter to only trigger a review from a specified group when it involves '*.yml' like this:

enter image description here

This seems to trigger if I make a change to yaml files. However, I've also got 3 other policies that have a path filter of '!*.yml'. The aim of this was to stop the other normal reviewer groups being added if it was a yaml file that was changed.

Prior to adding this path filter those policies triggered reviewers to be added correctly but it looks like the addition of this filter has now stopped them working. So even though only files that aren't yaml are altered the correct reviewer groups are no longer being added. Does the '!' only work with folders?

1 Answers

I have tested and the same error as yours.

enter image description here

"*.yml" works as expected. "!*.yml" doesn't work.

enter image description here

And "!/{folder}/*" works, seems "!" only works for folder.

A work around for this could be create a new folder and add your issued .yml file into the folder. And use "!" to exclude the issued file within the folder.

Related