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() {
15
15
if [[ "$scala_sha" != "" ]]; then
16
16
local jsonTemplate='{ "state": "%s", "target_url": "%s", "description": "%s", "context": "%s"}'
17
17
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
18
22
19
23
local curlStatus=$(curl \
20
- -s -o /dev/null -w "%{http_code}" \
24
+ -s -o $tmpfile -w "%{http_code}" \
21
25
-H "Accept: application/vnd.github.v3+json" \
22
26
-H "Authorization: token $GITHUB_OAUTH_TOKEN" \
23
27
-d "$json" \
24
28
https://api.github.com/repos/scala/scala/statuses/$scala_sha)
25
29
26
30
[[ "$curlStatus" == "201" ]] || {
27
- echo "Failed to publish GitHub commit status"
31
+ echo "Failed to publish GitHub commit status. Got: $curlStatus"
32
+ cat $tmpfile
28
33
exit 1
29
34
}
30
35
fi
You can’t perform that action at this time.
0 commit comments