Skip to content

Commit 16c17dd

Browse files
aduh95MylesBorins
authored andcommitted
build: fix Commit Queue failure comment
Refs: #35206 PR-URL: #35599 Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 6284f0d commit 16c17dd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/actions/commit-queue.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ for pr in "$@"; do
6767
if ! tail -n 10 output | grep '. Post "Landed in .*/pull/'"${pr}"; then
6868
gitHubCurl "$(labelsUrl "$pr")" POST --data '{"labels": ["'"${COMMIT_QUEUE_FAILED_LABEL}"'"]}'
6969

70-
cqurl="Commit Queue action: $GITHUB_SERVER_URL/${OWNER}/${REPOSITORY}/actions/runs/$GITHUB_RUN_ID"
71-
jq -n --arg content "<details><summary>Commit Queue failed</summary><pre>$(cat output)</pre></details>\n$cqurl" '{body: $content}' > output.json
70+
# Use printf to properly escape newline symbols for jq.
71+
printf -v cqurl "\n\nCommit Queue action: %s/%s/%s/actions/runs/%s" \
72+
"$GITHUB_SERVER_URL" "${OWNER}" "${REPOSITORY}" "$GITHUB_RUN_ID"
73+
jq -n --arg content "<details><summary>Commit Queue failed</summary><pre>$(cat output)</pre></details>$cqurl" '{body: $content}' > output.json
7274
cat output.json
7375

7476
gitHubCurl "$(commentsUrl "$pr")" POST --data @output.json

0 commit comments

Comments
 (0)