From ac5df63952dbcbb0b76c429913e37b84559e012a Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sun, 11 Oct 2020 17:00:49 +0200 Subject: [PATCH] build: fix Commit Queue failure comment Refs: https://github.com/nodejs/node/pull/35206 PR-URL: https://github.com/nodejs/node/pull/35599 Reviewed-By: Denys Otrishko Reviewed-By: Rich Trott --- tools/actions/commit-queue.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/actions/commit-queue.sh b/tools/actions/commit-queue.sh index ec2475067965be..d754276bf89b04 100755 --- a/tools/actions/commit-queue.sh +++ b/tools/actions/commit-queue.sh @@ -67,8 +67,10 @@ for pr in "$@"; do if ! tail -n 10 output | grep '. Post "Landed in .*/pull/'"${pr}"; then gitHubCurl "$(labelsUrl "$pr")" POST --data '{"labels": ["'"${COMMIT_QUEUE_FAILED_LABEL}"'"]}' - cqurl="Commit Queue action: $GITHUB_SERVER_URL/${OWNER}/${REPOSITORY}/actions/runs/$GITHUB_RUN_ID" - jq -n --arg content "
Commit Queue failed
$(cat output)
\n$cqurl" '{body: $content}' > output.json + # Use printf to properly escape newline symbols for jq. + printf -v cqurl "\n\nCommit Queue action: %s/%s/%s/actions/runs/%s" \ + "$GITHUB_SERVER_URL" "${OWNER}" "${REPOSITORY}" "$GITHUB_RUN_ID" + jq -n --arg content "
Commit Queue failed
$(cat output)
$cqurl" '{body: $content}' > output.json cat output.json gitHubCurl "$(commentsUrl "$pr")" POST --data @output.json