From 5fc886f68e3917a776f7e1699e9647b98adfce32 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 29 Dec 2021 21:57:57 -0800 Subject: [PATCH] tools: do not mask errors on multiple commit retrieval MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In commit-queue.sh, the assignment to `commits` will succeed and the script will continue if one of the two `git` commands fails, even with `-e` set. Split it into three separate assignments so that failures in the `git` commands will be clearly logged and cause the script to exit with a failure status code. PR-URL: https://github.com/nodejs/node/pull/41340 Reviewed-By: Tierney Cyren Reviewed-By: Tobias Nießen Reviewed-By: Franziska Hinkelmann --- tools/actions/commit-queue.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/actions/commit-queue.sh b/tools/actions/commit-queue.sh index bb231c6a0b9b84..bf6e06173c8138 100755 --- a/tools/actions/commit-queue.sh +++ b/tools/actions/commit-queue.sh @@ -72,7 +72,9 @@ for pr in "$@"; do fi if [ -z "$MULTIPLE_COMMIT_POLICY" ]; then - commits="$(git rev-parse $UPSTREAM/$DEFAULT_BRANCH)...$(git rev-parse HEAD)" + start_sha=$(git rev-parse $UPSTREAM/$DEFAULT_BRANCH) + end_sha=$(git rev-parse HEAD) + commits="${start_sha}...${end_sha}" if ! git push $UPSTREAM $DEFAULT_BRANCH >> output 2>&1; then commit_queue_failed "$pr"