report_errors.sh: Don't try to communicate with github if path or line is not known

This commit is contained in:
Kamil Śliwak 2021-01-15 21:26:39 +01:00
parent ca7327ec3f
commit 433c261a2f

View File

@ -47,6 +47,8 @@ function post_review_comment_to_github
do do
ERROR_PATH=$(echo $line | grep -oE ".*\.cpp") ERROR_PATH=$(echo $line | grep -oE ".*\.cpp")
ERROR_LINE=$(echo $line | grep -oE "[0-9]*") ERROR_LINE=$(echo $line | grep -oE "[0-9]*")
[[ $ERROR_PATH != "" ]] || { echo "ERROR: Error message does not contain file path."; exit 1; }
[[ $ERROR_LINE != "" ]] || { echo "ERROR: Error message does not contain line number."; exit 1; }
curl --request POST \ curl --request POST \
--url $GITHUB_API_URL \ --url $GITHUB_API_URL \