mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-25 23:51:07 -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"
|
MESSAGE="$FAIL_MSG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##############################################
|
##########################################################
|
||||||
# Call the status API to create status check #
|
# Check to see if were enabled for multi Status mesaages #
|
||||||
##############################################
|
##########################################################
|
||||||
SEND_STATUS_CMD=$(curl -f -s -X POST \
|
if [ $MULTI_STATUS == "true" ]; then
|
||||||
--url "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \
|
##############################################
|
||||||
-H 'accept: application/vnd.github.v3+json' \
|
# Call the status API to create status check #
|
||||||
-H "authorization: Bearer $GITHUB_TOKEN" \
|
##############################################
|
||||||
-H 'content-type: application/json' \
|
SEND_STATUS_CMD=$(curl -f -s -X POST \
|
||||||
-d "{ \"state\": \"$STATUS\",
|
--url "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \
|
||||||
\"target_url\": \"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\",
|
-H 'accept: application/vnd.github.v3+json' \
|
||||||
\"description\": \"$MESSAGE\", \"context\": \"--> Linted: $LANGUAGE\"
|
-H "authorization: Bearer $GITHUB_TOKEN" \
|
||||||
}" 2>&1)
|
-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 #
|
# Load the error code #
|
||||||
#######################
|
#######################
|
||||||
ERROR_CODE=$?
|
ERROR_CODE=$?
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
# Check the shell for errors #
|
# Check the shell for errors #
|
||||||
##############################
|
##############################
|
||||||
if [ "$ERROR_CODE" -ne 0 ]; then
|
if [ "$ERROR_CODE" -ne 0 ]; then
|
||||||
# ERROR
|
# ERROR
|
||||||
echo "ERROR! Failed to call GitHub Status API!"
|
echo "ERROR! Failed to call GitHub Status API!"
|
||||||
echo "ERROR:[$SEND_STATUS_CMD]"
|
echo "ERROR:[$SEND_STATUS_CMD]"
|
||||||
# Not going to fail the script on this yet...
|
# Not going to fail the script on this yet...
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
Loading…
Reference in a new issue