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 <shishugi@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Antoine du Hamel authored and Rich Trott committed 2020-10-14 06:11:13 -07:00
1 parent 92610f330d
commit ac5df63952
1 file changed
+4 -2
+4 -2
View File
@@ -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 "<details><summary>Commit Queue failed</summary><pre>$(cat output)</pre></details>\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 "<details><summary>Commit Queue failed</summary><pre>$(cat output)</pre></details>$cqurl" '{body: $content}' > output.json
cat output.json
gitHubCurl "$(commentsUrl "$pr")" POST --data @output.json