@@ -7,7 +7,7 @@ REPORT_STATUS_NOT_AVAILABLE="NOT_AVAILABLE"
7
7
REPORT_STATUS_TEST_AVAILABLE=" TEST_AVAILABLE"
8
8
REPORT_STATUS_IN_PROGRESS=" IN_PROGRESS"
9
9
REQUESTING_CI=" circle-ci"
10
- REPORT_FORMAT=" [ \ " plainText\ " , \ " richHtml\" ] "
10
+ REPORT_FORMAT=' [ "plainText", "richHtml"] '
11
11
12
12
# Error scenario mappings
13
13
declare -A ERROR_SCENARIOS=(
@@ -39,7 +39,7 @@ make_api_request() {
39
39
-D " $header_file " \
40
40
-d " {
41
41
\" originalBuildName\" : \" ${BROWSERSTACK_BUILD_NAME} \" ,
42
- \" buildStartedAt\" : \" $( date -u + " %Y-%m-%dT%H:%M:%SZ " ) \" ,
42
+ \" buildStartedAt\" : \" $( date +%s ) \" ,
43
43
\" requestingCi\" : \" $REQUESTING_CI \" ,
44
44
\" reportFormat\" : $REPORT_FORMAT ,
45
45
\" requestType\" : \" $request_type \" ,
@@ -53,6 +53,10 @@ make_api_request() {
53
53
54
54
# Clean up the temporary file
55
55
rm -f " $header_file "
56
+
57
+ if [[ -z " $body " ]]; then
58
+ body=' ""'
59
+ fi
56
60
57
61
# Return both status code and body as a JSON object
58
62
echo " {\" status_code\" : $http_status , \" body\" : $body }"
0 commit comments