Skip to content

Commit

Permalink
tools: hide commit queue action link
Browse files Browse the repository at this point in the history
PR-URL: #36124
Reviewed-By: Denys Otrishko <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
aduh95 authored and BethGriggs committed Dec 9, 2020
1 parent d679570 commit 6ae635c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tools/actions/commit-queue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ 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}"'"]}'

# 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
cqurl="${GITHUB_SERVER_URL}/${OWNER}/${REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
jq -n --arg content "<details><summary>Commit Queue failed</summary><pre>$(cat output)</pre><a href='$cqurl'>$cqurl</a></details>" '{body: $content}' > output.json
cat output.json

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

0 comments on commit 6ae635c

Please sign in to comment.