Skip to content

Commit

Permalink
build: fix Commit Queue failure comment
Browse files Browse the repository at this point in the history
Refs: nodejs#35206

PR-URL: nodejs#35599
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
aduh95 authored and Trott committed Oct 14, 2020
1 parent 92610f3 commit ac5df63
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/actions/commit-queue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ac5df63

Please sign in to comment.