File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -15,16 +15,21 @@ function postCommitStatus() {
1515 if [[ "$scala_sha" != "" ]]; then
1616 local jsonTemplate='{ "state": "%s", "target_url": "%s", "description": "%s", "context": "%s"}'
1717 local json=$(printf "$jsonTemplate" "$1" "https://travis-ci.com/scala/scala-dist/builds/$TRAVIS_BUILD_ID" "$1" "travis/scala-dist/$version/$mode")
18+ [[ -z "$GITHUB_OAUTH_TOKEN" ]] && (echo "Missing environment variable GITHUB_OAUTH_TOKEN!"; exit 1)
19+ TMPFILE=$(mktemp -t curl.XXXXXXXXXX)
20+
21+ local tmpfile=$(mktemp -t curl.XXXXXXXXXX) || exit 1
1822
1923 local curlStatus=$(curl \
20- -s -o /dev/null -w "%{http_code}" \
24+ -s -o $tmpfile -w "%{http_code}" \
2125 -H "Accept: application/vnd.github.v3+json" \
2226 -H "Authorization: token $GITHUB_OAUTH_TOKEN" \
2327 -d "$json" \
2428 https://api.github.com/repos/scala/scala/statuses/$scala_sha)
2529
2630 [[ "$curlStatus" == "201" ]] || {
27- echo "Failed to publish GitHub commit status"
31+ echo "Failed to publish GitHub commit status. Got: $curlStatus"
32+ cat $tmpfile
2833 exit 1
2934 }
3035 fi
You can’t perform that action at this time.
0 commit comments