Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
remove approval if the user changed their mind
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-chrismc committed Dec 29, 2020
1 parent 7a3b32d commit 884003b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pending_review/pull_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,17 @@ func (s *PullRequestService) GatherRelevantReviews(ctx context.Context, owner st
if isC3iTeam {
p.HeadCommitBlockers = appendUnique(p.HeadCommitBlockers, reviewerName)
}

p.HeadCommitApprovals = removeUnique(p.HeadCommitApprovals, reviewerName)
case APPRVD:
p.AtLeastOneApproval = true
if onBranchHead {
p.HeadCommitApprovals = appendUnique(p.HeadCommitApprovals, reviewerName)
}

if len(p.HeadCommitBlockers) > 0 {
p.HeadCommitBlockers = removeUnique(p.HeadCommitBlockers, reviewerName)
}
p.HeadCommitBlockers = removeUnique(p.HeadCommitBlockers, reviewerName)
case DISMISSED:
if len(p.HeadCommitBlockers) > 0 {
p.HeadCommitBlockers = removeUnique(p.HeadCommitBlockers, reviewerName)
}
p.HeadCommitBlockers = removeUnique(p.HeadCommitBlockers, reviewerName)
default:
}
}
Expand Down

0 comments on commit 884003b

Please sign in to comment.