Skip to content

Commit ee29ef5

Browse files
committed
Improve error messages in publish_report_to_repository and publish_report_to_gist
Missing GitHub token is likely to be a common problem for people forking repositories so it's important that the error message specifies exactly which argument was missing.
1 parent 084aefb commit ee29ef5

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

arduino-ci-script.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,15 @@ function publish_report_to_repository()
911911
echo "No report file available for this job"
912912
fi
913913
else
914-
echo "Publishing report failed. GitHub token, repository URL, and repository branch must be defined to use this function. See https://github.com/per1234/arduino-ci-script#publishing-job-reports for instructions."
914+
if [[ "$token" == "" ]]; then
915+
echo "ERROR: GitHub token not specified. Failed to publish build report. See https://github.com/per1234/arduino-ci-script#publishing-job-reports for instructions."
916+
fi
917+
if [[ "$repositoryURL" == "" ]]; then
918+
echo "ERROR: Repository URL not specified. Failed to publish build report."
919+
fi
920+
if [[ "$reportBranch" == "" ]]; then
921+
echo "ERROR: Repository branch not specified. Failed to publish build report."
922+
fi
915923
return "$ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS"
916924
fi
917925

@@ -957,7 +965,12 @@ curlDataHere
957965
echo "No report file available for this job"
958966
fi
959967
else
960-
echo "Publishing report failed. GitHub token and gist URL must be defined in your Travis CI settings for this repository in order to use this function. See https://github.com/per1234/arduino-ci-script#publishing-job-reports for instructions."
968+
if [[ "$token" == "" ]]; then
969+
echo "ERROR: GitHub token not specified. Failed to publish build report. See https://github.com/per1234/arduino-ci-script#publishing-job-reports for instructions."
970+
fi
971+
if [[ "$gistURL" == "" ]]; then
972+
echo "ERROR: Gist URL not specified. Failed to publish build report. See https://github.com/per1234/arduino-ci-script#publishing-job-reports for instructions."
973+
fi
961974
return "$ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS"
962975
fi
963976

0 commit comments

Comments
 (0)