Using the new pull request approval process in Github, if I approve a PR but then a dev pushes a new commit to that branch I'd want the PR to go back to the state it is in to start with (i.e. not approved).
At the moment it stays green but in reality there is code that hasn't been reviewed in the branch.
On the "Conversation" tab, scroll to the review you'd like to dismiss, then click . Click , then click Dismiss review. Type your reason for dismissing the review, then click Dismiss review.
As long as the pull request is still open, it should get updated with any added commits automatically.
Under your repository name, click Pull requests. In the "Pull Requests" list, click the pull request you'd like to close. At the bottom of the pull request, below the comment box, click Close pull request. Optionally, delete the branch.
On GitHub, navigate to the main page of the repository. Under your repository name, click Settings. In the left menu, click Branches. Select the branch you want to restrict using the drop-down menu.
Select Dismiss stale pull request approvals when new commits are pushed.
This dismisses a pull request approval review when a code-modifying commit is pushed to the branch.
Click Save changes.
Ref: https://help.github.com/articles/enabling-required-reviews-for-pull-requests/
It's not clear from your question if you need this automatically done, or if a manual process is okay too.
In my case a manual solution was fine. We'll just rely on developers to use their judgment on whether a PR should be unapproved.
To manually unapprove a PR, you can go to the comments section where the approval is, and click "show all reviewers". Then choose Dismiss for each approved review.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With