1
0
Fork 0

lint(scripts): make github status body readable

This commit is contained in:
ssube 2019-09-18 06:08:12 -05:00
parent 65f9bb2db6
commit e6688b7f97
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 9 additions and 1 deletions

View File

@ -3,7 +3,15 @@
STATUS="${1}"
CI_COMMIT_SHA="${CI_COMMIT_SHA:-$(git rev-parse HEAD)}"
STATUS_BODY="{\"state\": \"${STATUS}\", \"target_url\": \"${CI_PIPELINE_URL}\", \"description\": \"CI pipeline ${STATUS}!\", \"context\": \"gitlab/build\"}"
STATUS_BODY="$(cat <<EOF
{
"state": "${STATUS}",
"target_url": "${CI_PIPELINE_URL}",
"description": "CI pipeline ${STATUS}!",
"context": "gitlab/build"
}
EOF
)"
printf "Reporting status for %s...\n%s" "${CI_COMMIT_SHA}" "${STATUS_BODY}"
printf "%s" "${STATUS_BODY}" | curl -d @- \