mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-25 10:10:56 -05:00
Adding logic to skip status without proper data
This commit is contained in:
parent
4d079ba298
commit
6022bd2ee6
1 changed files with 29 additions and 24 deletions
|
@ -826,32 +826,37 @@ CallStatusAPI() {
|
|||
MESSAGE="$FAIL_MSG"
|
||||
fi
|
||||
|
||||
##############################################
|
||||
# Call the status API to create status check #
|
||||
##############################################
|
||||
SEND_STATUS_CMD=$(curl -f -s -X POST \
|
||||
--url "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \
|
||||
-H 'accept: application/vnd.github.v3+json' \
|
||||
-H "authorization: Bearer $GITHUB_TOKEN" \
|
||||
-H 'content-type: application/json' \
|
||||
-d "{ \"state\": \"$STATUS\",
|
||||
\"target_url\": \"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\",
|
||||
\"description\": \"$MESSAGE\", \"context\": \"--> Linted: $LANGUAGE\"
|
||||
}" 2>&1)
|
||||
##########################################################
|
||||
# Check to see if were enabled for multi Status mesaages #
|
||||
##########################################################
|
||||
if [ $MULTI_STATUS == "true" ]; then
|
||||
##############################################
|
||||
# Call the status API to create status check #
|
||||
##############################################
|
||||
SEND_STATUS_CMD=$(curl -f -s -X POST \
|
||||
--url "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \
|
||||
-H 'accept: application/vnd.github.v3+json' \
|
||||
-H "authorization: Bearer $GITHUB_TOKEN" \
|
||||
-H 'content-type: application/json' \
|
||||
-d "{ \"state\": \"$STATUS\",
|
||||
\"target_url\": \"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\",
|
||||
\"description\": \"$MESSAGE\", \"context\": \"--> Linted: $LANGUAGE\"
|
||||
}" 2>&1)
|
||||
|
||||
#######################
|
||||
# Load the error code #
|
||||
#######################
|
||||
ERROR_CODE=$?
|
||||
#######################
|
||||
# Load the error code #
|
||||
#######################
|
||||
ERROR_CODE=$?
|
||||
|
||||
##############################
|
||||
# Check the shell for errors #
|
||||
##############################
|
||||
if [ "$ERROR_CODE" -ne 0 ]; then
|
||||
# ERROR
|
||||
echo "ERROR! Failed to call GitHub Status API!"
|
||||
echo "ERROR:[$SEND_STATUS_CMD]"
|
||||
# Not going to fail the script on this yet...
|
||||
##############################
|
||||
# Check the shell for errors #
|
||||
##############################
|
||||
if [ "$ERROR_CODE" -ne 0 ]; then
|
||||
# ERROR
|
||||
echo "ERROR! Failed to call GitHub Status API!"
|
||||
echo "ERROR:[$SEND_STATUS_CMD]"
|
||||
# Not going to fail the script on this yet...
|
||||
fi
|
||||
fi
|
||||
}
|
||||
################################################################################
|
||||
|
|
Loading…
Reference in a new issue