In our repository, the “Dismiss stale pull request approvals when new commits are pushed” option is enabled.
However, it often happens that you need to rebase your branch to the head of master, or maybe squash commits or change commit messages. If you do this and then force-push to your branch, reviews are dismissed and you need to get a new review.
Is there a way to set up the repository such that force-pushes do not dismiss reviews as long as the code diff is the same? If this option is not available in core GitHub, how could a webhook be set up to do it?