I am failing to set a rule to ignore Pull Request Policy on specific path using 'Path Filters'. Using one of the 2 options below both did not work.
'Path Filter' = '/BIS/*; /*; !/26740.yml'
Or
'Path Filter' = '!/26740.yml'
Any Edit to '26740.yml' located on the root of the repository should ignore the Pull Request Policy.
Even with this setting i get error on push
! [remote rejected] dev/26740.01 -> dev/26740.01 (TF402455: Pushes to this branch are not permitted; you must use a pull request to update this branch.)
error: failed to push some refs to 'https://dev.azure.com/xxx/GIT/_git/xxxGit'
Build Validation is the only Policy for this branch
Repo Structure
Tried from Both - online web update of the file & OnPrem edit & Push same error. Push to branch without the policy works.
According to Can I push changes directly to branches that have branch policies?,
You can't push changes directly to branches with required branch policies unless you have permissions to bypass branch policies. Changes to these branches can be made only through pull requests. You can push changes directly to branches that have optional branch policies, if they have no required branch policies.
Path filters are not used to bypass branch policy, but to trigger the validation pipeline only when the changed files satisfy the path filters.