From 47f51c2ead7073b69586a61a968f643658368c40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matias=20Niemel=C3=A4?= Date: Wed, 14 Feb 2018 22:55:56 -0500 Subject: [PATCH] Revert "Revert "build: merge-pr new checks that all requested changes have been addressed (#21817)"" This reverts commit 5b8eb9c5c78e7724c84bf359bdff7ad96858dad1. --- scripts/github/merge-pr | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/github/merge-pr b/scripts/github/merge-pr index 937f577be4..e26fc1474b 100755 --- a/scripts/github/merge-pr +++ b/scripts/github/merge-pr @@ -43,6 +43,7 @@ PULL_JSON=`curl -s https://api.github.com/repos/angular/angular/pulls/$PR_NUMBER PR_SHA_COUNT=`node $BASEDIR/utils/json_extract.js commits <<< """$PULL_JSON"""` STATUS_JSON_URL=`node $BASEDIR/utils/json_extract.js _links.statuses.href <<< """$PULL_JSON"""` STATUS=`curl -s $STATUS_JSON_URL | node $BASEDIR/utils/json_extract.js description | cut -d '|' -f1` +MERGE_STATUS=`curl -s https://api.github.com/repos/angular/angular/pulls/$PR_NUMBER/reviews | node ./scripts/github/utils/json_extract.js state` PR_LABELS=`curl -s https://api.github.com/repos/angular/angular/issues/$PR_NUMBER/labels` PR_ACTION=`echo "$PR_LABELS" | node $BASEDIR/utils/json_extract.js "name=^PR action:"` PR_TARGET=`echo "$PR_LABELS" | node $BASEDIR/utils/json_extract.js "name=^PR target:"` @@ -60,6 +61,11 @@ if [[ "$PR_CLA" != "cla: yes" ]]; then exit 1 fi +if [[ $MERGE_STATUS == *CHANGES_REQUESTED* ]]; then + echo The PR $PR_NUMBER has not been approved by all reviewers. Ask PR owner to obtain reviews or dismiss reviews and document the dismissal reason. + exit 1 +fi + if [[ "$STATUS" != "All checks passed!" ]]; then echo PR $PR_NUMBER is failing with: $STATUS if [[ $FORCE == 1 ]]; then