Skip to content

Commit

Permalink
fix: in review submitted event, use updated pr in approveShouldWait too
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed Dec 31, 2021
1 parent 3ce788d commit 8848afb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/events/pr-handlers/reviewSubmitted.ts
Expand Up @@ -67,9 +67,10 @@ export default function reviewSubmitted(
reviewerGroup &&
repoContext.config.labels.review[reviewerGroup]
) {
const updatedPr = await fetchPr(context, pullRequest.number);
const hasRequestedReviewsForGroup = repoContext.approveShouldWait(
reviewerGroup,
pullRequest,
updatedPr,
{
includesReviewerGroup: true,
// TODO reenable this when accepted can notify request review to slack (dev accepted => design requested) and flag to disable for label (approved design ; still waiting for dev ?)
Expand All @@ -85,8 +86,6 @@ export default function reviewSubmitted(
!hasChangesRequestedInReviews &&
state === 'approved';

const updatedPr = await fetchPr(context, pullRequest.number);

const newLabels = await updateReviewStatus(
updatedPr,
context,
Expand Down

0 comments on commit 8848afb

Please sign in to comment.