Skip to content

Commit

Permalink
[Fix] display review status first as output now shows check status
Browse files Browse the repository at this point in the history
  • Loading branch information
Green-Ranger11 committed Mar 14, 2022
1 parent a8a1fb3 commit 7f6cdb7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions utils/evaluatePullRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ module.exports = function evaluatePullRequest(response, requiredChecks) {
if (!doesPRHaveConflicts(response)) {
return pullRequestStatus.CONFLICT;
}

if (reviewDecision === 'CHANGES_REQUESTED') {
return pullRequestStatus.REVIEW_DISAPPROVED;
} else if (reviewDecision === 'REVIEW_REQUIRED') {
return pullRequestStatus.REVIEW_REQUIRED;
}

const { failure, pending } = evaluateChecks(response, requiredChecks);

if (failure.some((f) => f.isRequired)) {
Expand All @@ -34,11 +41,5 @@ module.exports = function evaluatePullRequest(response, requiredChecks) {
return pullRequestStatus.STATUS_PENDING;
}

if (reviewDecision === 'CHANGES_REQUESTED') {
return pullRequestStatus.REVIEW_DISAPPROVED;
} else if (reviewDecision === 'REVIEW_REQUIRED') {
return pullRequestStatus.REVIEW_REQUIRED;
}

return pullRequestStatus.MERGEABLE;
};

0 comments on commit 7f6cdb7

Please sign in to comment.