Selectively remove approvals from a pull request when changes have been made.
I have a pull request open for a new feature with members of the development team and members of the documentation team set as reviewers.
Several of my reviewers from the development team have approved already, but I need to address some comments resulting in code changes.
I want to automatically withdraw approvals from members of the development team when there are changes pushed to a pull request.
This is to ensure the code is thoroughly checked. Approvals will remain for any reviewers not in the development team.
Good to Know
This script must be configured as a Custom listener for the PullRequestRescopedEvent event by someone with at least global administrator permission.
Use the REVIEWERS_WHICH_ALWAYS_WITHDRAW_APPROVAL string collection to add the users name for which approval will be withdrawn after each change