mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-22 14:10:56 -05:00
Remove trailing NC on log functions
This commit is contained in:
parent
af13245484
commit
008a3057c9
6 changed files with 98 additions and 98 deletions
|
@ -52,8 +52,8 @@ ValidateInput() {
|
||||||
# Validate GITHUB_WORKSPACE #
|
# Validate GITHUB_WORKSPACE #
|
||||||
############################
|
############################
|
||||||
if [ -z "${GITHUB_WORKSPACE}" ]; then
|
if [ -z "${GITHUB_WORKSPACE}" ]; then
|
||||||
error "Failed to get [GITHUB_WORKSPACE]!${NC}"
|
error "Failed to get [GITHUB_WORKSPACE]!"
|
||||||
fatal "[${GITHUB_WORKSPACE}]${NC}"
|
fatal "[${GITHUB_WORKSPACE}]"
|
||||||
else
|
else
|
||||||
echo "Successfully found:[GITHUB_WORKSPACE], value:[${GITHUB_WORKSPACE}]"
|
echo "Successfully found:[GITHUB_WORKSPACE], value:[${GITHUB_WORKSPACE}]"
|
||||||
fi
|
fi
|
||||||
|
@ -63,8 +63,8 @@ ValidateInput() {
|
||||||
#######################
|
#######################
|
||||||
if [ -z "${IMAGE_REPO}" ]; then
|
if [ -z "${IMAGE_REPO}" ]; then
|
||||||
# No repo was pulled
|
# No repo was pulled
|
||||||
error "Failed to get [IMAGE_REPO]!${NC}"
|
error "Failed to get [IMAGE_REPO]!"
|
||||||
fatal "[${IMAGE_REPO}]${NC}"
|
fatal "[${IMAGE_REPO}]"
|
||||||
elif [[ ${IMAGE_REPO} == "github/super-linter" ]]; then
|
elif [[ ${IMAGE_REPO} == "github/super-linter" ]]; then
|
||||||
# Found our main repo
|
# Found our main repo
|
||||||
echo "Successfully found:[IMAGE_REPO], value:[${IMAGE_REPO}]"
|
echo "Successfully found:[IMAGE_REPO], value:[${IMAGE_REPO}]"
|
||||||
|
@ -78,8 +78,8 @@ ValidateInput() {
|
||||||
# Validate IMAGE_VERSION #
|
# Validate IMAGE_VERSION #
|
||||||
##########################
|
##########################
|
||||||
if [ -z "${IMAGE_VERSION}" ]; then
|
if [ -z "${IMAGE_VERSION}" ]; then
|
||||||
error "Failed to get [IMAGE_VERSION]!${NC}"
|
error "Failed to get [IMAGE_VERSION]!"
|
||||||
fatal "[${IMAGE_VERSION}]${NC}"
|
fatal "[${IMAGE_VERSION}]"
|
||||||
else
|
else
|
||||||
echo "Successfully found:[IMAGE_VERSION], value:[${IMAGE_VERSION}]"
|
echo "Successfully found:[IMAGE_VERSION], value:[${IMAGE_VERSION}]"
|
||||||
fi
|
fi
|
||||||
|
@ -88,8 +88,8 @@ ValidateInput() {
|
||||||
# Validate DOCKER_USERNAME #
|
# Validate DOCKER_USERNAME #
|
||||||
############################
|
############################
|
||||||
if [ -z "${DOCKER_USERNAME}" ]; then
|
if [ -z "${DOCKER_USERNAME}" ]; then
|
||||||
error "Failed to get [DOCKER_USERNAME]!${NC}"
|
error "Failed to get [DOCKER_USERNAME]!"
|
||||||
fatal "[${DOCKER_USERNAME}]${NC}"
|
fatal "[${DOCKER_USERNAME}]"
|
||||||
else
|
else
|
||||||
echo "Successfully found:[DOCKER_USERNAME], value:[${DOCKER_USERNAME}]"
|
echo "Successfully found:[DOCKER_USERNAME], value:[${DOCKER_USERNAME}]"
|
||||||
fi
|
fi
|
||||||
|
@ -98,8 +98,8 @@ ValidateInput() {
|
||||||
# Validate DOCKER_PASSWORD #
|
# Validate DOCKER_PASSWORD #
|
||||||
############################
|
############################
|
||||||
if [ -z "${DOCKER_PASSWORD}" ]; then
|
if [ -z "${DOCKER_PASSWORD}" ]; then
|
||||||
error "Failed to get [DOCKER_PASSWORD]!${NC}"
|
error "Failed to get [DOCKER_PASSWORD]!"
|
||||||
fatal "[${DOCKER_PASSWORD}]${NC}"
|
fatal "[${DOCKER_PASSWORD}]"
|
||||||
else
|
else
|
||||||
echo "Successfully found:[DOCKER_PASSWORD], value:[********]"
|
echo "Successfully found:[DOCKER_PASSWORD], value:[********]"
|
||||||
fi
|
fi
|
||||||
|
@ -148,8 +148,8 @@ LoginToDocker() {
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# ERROR
|
# ERROR
|
||||||
error "Failed to authenticate to DockerHub!${NC}"
|
error "Failed to authenticate to DockerHub!"
|
||||||
fatal "[${LOGIN_CMD}]${NC}"
|
fatal "[${LOGIN_CMD}]"
|
||||||
else
|
else
|
||||||
# SUCCESS
|
# SUCCESS
|
||||||
echo "Successfully authenticated to DockerHub!"
|
echo "Successfully authenticated to DockerHub!"
|
||||||
|
@ -186,8 +186,8 @@ RemoveImage() {
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# ERROR
|
# ERROR
|
||||||
error "Failed to gain token from DockerHub!${NC}"
|
error "Failed to gain token from DockerHub!"
|
||||||
fatal "[${TOKEN}]${NC}"
|
fatal "[${TOKEN}]"
|
||||||
else
|
else
|
||||||
# SUCCESS
|
# SUCCESS
|
||||||
echo "Successfully gained auth token from DockerHub!"
|
echo "Successfully gained auth token from DockerHub!"
|
||||||
|
@ -210,8 +210,8 @@ RemoveImage() {
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# ERROR
|
# ERROR
|
||||||
error "Failed to remove tag from DockerHub!${NC}"
|
error "Failed to remove tag from DockerHub!"
|
||||||
fatal "[${REMOVE_CMD}]${NC}"
|
fatal "[${REMOVE_CMD}]"
|
||||||
else
|
else
|
||||||
# SUCCESS
|
# SUCCESS
|
||||||
echo "Successfully [removed] Docker image tag:[${IMAGE_VERSION}] from DockerHub!"
|
echo "Successfully [removed] Docker image tag:[${IMAGE_VERSION}] from DockerHub!"
|
||||||
|
|
|
@ -53,8 +53,8 @@ CheckGHEPid()
|
||||||
# Check the shell for errors #
|
# Check the shell for errors #
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
error "Failed to sleep!${NC}"
|
error "Failed to sleep!"
|
||||||
error "[${SLEEP_CMD}]${NC}"
|
error "[${SLEEP_CMD}]"
|
||||||
echo "Will try to call apply as last effort..."
|
echo "Will try to call apply as last effort..."
|
||||||
####################################
|
####################################
|
||||||
# Call config apply as last effort #
|
# Call config apply as last effort #
|
||||||
|
@ -117,8 +117,8 @@ CheckGHEProcess()
|
||||||
# Check the shell for errors #
|
# Check the shell for errors #
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
error "Failed to sleep!${NC}"
|
error "Failed to sleep!"
|
||||||
error "[${SLEEP_CMD}]${NC}"
|
error "[${SLEEP_CMD}]"
|
||||||
echo "Will try to call apply as last effort..."
|
echo "Will try to call apply as last effort..."
|
||||||
####################################
|
####################################
|
||||||
# Call config apply as last effort #
|
# Call config apply as last effort #
|
||||||
|
@ -161,8 +161,8 @@ RunConfigApply()
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# Errors
|
# Errors
|
||||||
error "Failed to run config apply command!${NC}"
|
error "Failed to run config apply command!"
|
||||||
fatal "[${APPLY_CMD}]${NC}"
|
fatal "[${APPLY_CMD}]"
|
||||||
else
|
else
|
||||||
# Success
|
# Success
|
||||||
notice "Successfully ran ${F[C]}${GHE_APPLY_COMMAND}${NC}"
|
notice "Successfully ran ${F[C]}${GHE_APPLY_COMMAND}${NC}"
|
||||||
|
|
|
@ -58,8 +58,8 @@ ValidateInput() {
|
||||||
# Validate GITHUB_WORKSPACE #
|
# Validate GITHUB_WORKSPACE #
|
||||||
#############################
|
#############################
|
||||||
if [ -z "${GITHUB_WORKSPACE}" ]; then
|
if [ -z "${GITHUB_WORKSPACE}" ]; then
|
||||||
error "Failed to get [GITHUB_WORKSPACE]!${NC}"
|
error "Failed to get [GITHUB_WORKSPACE]!"
|
||||||
fatal "[${GITHUB_WORKSPACE}]${NC}"
|
fatal "[${GITHUB_WORKSPACE}]"
|
||||||
else
|
else
|
||||||
notice "Successfully found:${F[W]}[GITHUB_WORKSPACE]${F[B]}, value:${F[W]}[${GITHUB_WORKSPACE}]${NC}"
|
notice "Successfully found:${F[W]}[GITHUB_WORKSPACE]${F[B]}, value:${F[W]}[${GITHUB_WORKSPACE}]${NC}"
|
||||||
fi
|
fi
|
||||||
|
@ -68,8 +68,8 @@ ValidateInput() {
|
||||||
# Validate REGISTRY #
|
# Validate REGISTRY #
|
||||||
#####################
|
#####################
|
||||||
if [ -z "${REGISTRY}" ]; then
|
if [ -z "${REGISTRY}" ]; then
|
||||||
error "Failed to get [REGISTRY]!${NC}"
|
error "Failed to get [REGISTRY]!"
|
||||||
fatal "[${REGISTRY}]${NC}"
|
fatal "[${REGISTRY}]"
|
||||||
else
|
else
|
||||||
notice "Successfully found:${F[W]}[REGISTRY]${F[B]}, value:${F[W]}[${REGISTRY}]${NC}"
|
notice "Successfully found:${F[W]}[REGISTRY]${F[B]}, value:${F[W]}[${REGISTRY}]${NC}"
|
||||||
fi
|
fi
|
||||||
|
@ -82,8 +82,8 @@ ValidateInput() {
|
||||||
# Validate GPR_USERNAME #
|
# Validate GPR_USERNAME #
|
||||||
#########################
|
#########################
|
||||||
if [ -z "${GPR_USERNAME}" ]; then
|
if [ -z "${GPR_USERNAME}" ]; then
|
||||||
error "Failed to get [GPR_USERNAME]!${NC}"
|
error "Failed to get [GPR_USERNAME]!"
|
||||||
fatal "[${GPR_USERNAME}]${NC}"
|
fatal "[${GPR_USERNAME}]"
|
||||||
else
|
else
|
||||||
notice "Successfully found:${F[W]}[GPR_USERNAME]${F[B]}, value:${F[W]}[${GPR_USERNAME}]${NC}"
|
notice "Successfully found:${F[W]}[GPR_USERNAME]${F[B]}, value:${F[W]}[${GPR_USERNAME}]${NC}"
|
||||||
fi
|
fi
|
||||||
|
@ -92,8 +92,8 @@ ValidateInput() {
|
||||||
# Validate GPR_TOKEN #
|
# Validate GPR_TOKEN #
|
||||||
######################
|
######################
|
||||||
if [ -z "${GPR_TOKEN}" ]; then
|
if [ -z "${GPR_TOKEN}" ]; then
|
||||||
error "Failed to get [GPR_TOKEN]!${NC}"
|
error "Failed to get [GPR_TOKEN]!"
|
||||||
fatal "[${GPR_TOKEN}]${NC}"
|
fatal "[${GPR_TOKEN}]"
|
||||||
else
|
else
|
||||||
notice "Successfully found:${F[W]}[GPR_TOKEN]${F[B]}, value:${F[W]}[********]${NC}"
|
notice "Successfully found:${F[W]}[GPR_TOKEN]${F[B]}, value:${F[W]}[********]${NC}"
|
||||||
fi
|
fi
|
||||||
|
@ -105,8 +105,8 @@ ValidateInput() {
|
||||||
# Validate DOCKER_USERNAME #
|
# Validate DOCKER_USERNAME #
|
||||||
############################
|
############################
|
||||||
if [ -z "${DOCKER_USERNAME}" ]; then
|
if [ -z "${DOCKER_USERNAME}" ]; then
|
||||||
error "Failed to get [DOCKER_USERNAME]!${NC}"
|
error "Failed to get [DOCKER_USERNAME]!"
|
||||||
fatal "[${DOCKER_USERNAME}]${NC}"
|
fatal "[${DOCKER_USERNAME}]"
|
||||||
else
|
else
|
||||||
notice "Successfully found:${F[W]}[DOCKER_USERNAME]${F[B]}, value:${F[W]}[${DOCKER_USERNAME}]${NC}"
|
notice "Successfully found:${F[W]}[DOCKER_USERNAME]${F[B]}, value:${F[W]}[${DOCKER_USERNAME}]${NC}"
|
||||||
fi
|
fi
|
||||||
|
@ -115,8 +115,8 @@ ValidateInput() {
|
||||||
# Validate DOCKER_PASSWORD #
|
# Validate DOCKER_PASSWORD #
|
||||||
############################
|
############################
|
||||||
if [ -z "${DOCKER_PASSWORD}" ]; then
|
if [ -z "${DOCKER_PASSWORD}" ]; then
|
||||||
error "Failed to get [DOCKER_PASSWORD]!${NC}"
|
error "Failed to get [DOCKER_PASSWORD]!"
|
||||||
fatal "[${DOCKER_PASSWORD}]${NC}"
|
fatal "[${DOCKER_PASSWORD}]"
|
||||||
else
|
else
|
||||||
notice "Successfully found:${F[W]}[DOCKER_PASSWORD]${F[B]}, value:${F[B]}[********]${NC}"
|
notice "Successfully found:${F[W]}[DOCKER_PASSWORD]${F[B]}, value:${F[B]}[********]${NC}"
|
||||||
fi
|
fi
|
||||||
|
@ -124,7 +124,7 @@ ValidateInput() {
|
||||||
# We were not passed a registry to update #
|
# We were not passed a registry to update #
|
||||||
###########################################
|
###########################################
|
||||||
else
|
else
|
||||||
error "Failed to find a valid registry!${NC}"
|
error "Failed to find a valid registry!"
|
||||||
fatal "Registry:[${REGISTRY}]"
|
fatal "Registry:[${REGISTRY}]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -132,8 +132,8 @@ ValidateInput() {
|
||||||
# Validate IMAGE_REPO #
|
# Validate IMAGE_REPO #
|
||||||
#######################
|
#######################
|
||||||
if [ -z "${IMAGE_REPO}" ]; then
|
if [ -z "${IMAGE_REPO}" ]; then
|
||||||
error "Failed to get [IMAGE_REPO]!${NC}"
|
error "Failed to get [IMAGE_REPO]!"
|
||||||
fatal "[${IMAGE_REPO}]${NC}"
|
fatal "[${IMAGE_REPO}]"
|
||||||
else
|
else
|
||||||
notice "Successfully found:${F[W]}[IMAGE_REPO]${F[B]}, value:${F[W]}[${IMAGE_REPO}]${NC}"
|
notice "Successfully found:${F[W]}[IMAGE_REPO]${F[B]}, value:${F[W]}[${IMAGE_REPO}]${NC}"
|
||||||
###############################################
|
###############################################
|
||||||
|
@ -166,8 +166,8 @@ ValidateInput() {
|
||||||
# Check the shell for errors #
|
# Check the shell for errors #
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
error "Failed to get branch name!${NC}"
|
error "Failed to get branch name!"
|
||||||
fatal "[${BRANCH_NAME}]${NC}"
|
fatal "[${BRANCH_NAME}]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
|
@ -212,8 +212,8 @@ ValidateInput() {
|
||||||
# Validate DOCKERFILE_PATH #
|
# Validate DOCKERFILE_PATH #
|
||||||
############################
|
############################
|
||||||
if [ -z "${DOCKERFILE_PATH}" ]; then
|
if [ -z "${DOCKERFILE_PATH}" ]; then
|
||||||
error "Failed to get [DOCKERFILE_PATH]!${NC}"
|
error "Failed to get [DOCKERFILE_PATH]!"
|
||||||
fatal "[${DOCKERFILE_PATH}]${NC}"
|
fatal "[${DOCKERFILE_PATH}]"
|
||||||
else
|
else
|
||||||
notice "Successfully found:${F[W]}[DOCKERFILE_PATH]${F[B]}, value:${F[W]}[${DOCKERFILE_PATH}]${NC}"
|
notice "Successfully found:${F[W]}[DOCKERFILE_PATH]${F[B]}, value:${F[W]}[${DOCKERFILE_PATH}]${NC}"
|
||||||
fi
|
fi
|
||||||
|
@ -253,8 +253,8 @@ Authenticate() {
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# ERROR
|
# ERROR
|
||||||
error "Failed to authenticate to ${NAME}!${NC}"
|
error "Failed to authenticate to ${NAME}!"
|
||||||
fatal "[${LOGIN_CMD}]${NC}"
|
fatal "[${LOGIN_CMD}]"
|
||||||
fatal else
|
fatal else
|
||||||
# SUCCESS
|
# SUCCESS
|
||||||
notice "Successfully authenticated to ${F[C]}${NAME}${F[B]}!${NC}"
|
notice "Successfully authenticated to ${F[C]}${NAME}${F[B]}!${NC}"
|
||||||
|
@ -277,7 +277,7 @@ BuildImage() {
|
||||||
################################
|
################################
|
||||||
if [ ! -f "${DOCKERFILE_PATH}" ]; then
|
if [ ! -f "${DOCKERFILE_PATH}" ]; then
|
||||||
# No file found
|
# No file found
|
||||||
error "failed to find Dockerfile at:[${DOCKERFILE_PATH}]${NC}"
|
error "failed to find Dockerfile at:[${DOCKERFILE_PATH}]"
|
||||||
error "Please make sure you give full path!"
|
error "Please make sure you give full path!"
|
||||||
fatal "Example:[/configs/Dockerfile] or [Dockerfile] if at root directory"
|
fatal "Example:[/configs/Dockerfile] or [Dockerfile] if at root directory"
|
||||||
fi
|
fi
|
||||||
|
@ -297,7 +297,7 @@ BuildImage() {
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# ERROR
|
# ERROR
|
||||||
fatal "failed to [build] Dockerfile!${NC}"
|
fatal "failed to [build] Dockerfile!"
|
||||||
else
|
else
|
||||||
# SUCCESS
|
# SUCCESS
|
||||||
notice "Successfully Built image!${NC}"
|
notice "Successfully Built image!${NC}"
|
||||||
|
@ -320,7 +320,7 @@ BuildImage() {
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# ERROR
|
# ERROR
|
||||||
fatal "failed to [tag] Dockerfile!${NC}"
|
fatal "failed to [tag] Dockerfile!"
|
||||||
else
|
else
|
||||||
# SUCCESS
|
# SUCCESS
|
||||||
notice "Successfully tagged image!${NC}"
|
notice "Successfully tagged image!${NC}"
|
||||||
|
@ -354,7 +354,7 @@ UploadImage() {
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# ERROR
|
# ERROR
|
||||||
fatal "failed to [upload] Dockerfile!${NC}"
|
fatal "failed to [upload] Dockerfile!"
|
||||||
else
|
else
|
||||||
# SUCCESS
|
# SUCCESS
|
||||||
notice "Successfully Uploaded Docker image:${F[W]}[${IMAGE_VERSION}]${F[B]} to ${F[C]}${REGISTRY}${F[B]}!${NC}"
|
notice "Successfully Uploaded Docker image:${F[W]}[${IMAGE_VERSION}]${F[B]} to ${F[C]}${REGISTRY}${F[B]}!${NC}"
|
||||||
|
@ -376,8 +376,8 @@ UploadImage() {
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# ERROR
|
# ERROR
|
||||||
error "Failed to get information about built Image!${NC}"
|
error "Failed to get information about built Image!"
|
||||||
fatal "[${GET_INFO_CMD}]${NC}"
|
fatal "[${GET_INFO_CMD}]"
|
||||||
else
|
else
|
||||||
################
|
################
|
||||||
# Get the data #
|
# Get the data #
|
||||||
|
@ -418,7 +418,7 @@ UploadImage() {
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# ERROR
|
# ERROR
|
||||||
fatal "failed to [upload] MAJOR_TAG:[${MAJOR_TAG}] Dockerfile!${NC}"
|
fatal "failed to [upload] MAJOR_TAG:[${MAJOR_TAG}] Dockerfile!"
|
||||||
else
|
else
|
||||||
# SUCCESS
|
# SUCCESS
|
||||||
notice "Successfully Uploaded TAG:${F[W]}[${MAJOR_TAG}]${F[B]} of Docker image to ${F[C]}${REGISTRY}${F[B]}!${NC}"
|
notice "Successfully Uploaded TAG:${F[W]}[${MAJOR_TAG}]${F[B]} of Docker image to ${F[C]}${REGISTRY}${F[B]}!${NC}"
|
||||||
|
@ -471,7 +471,7 @@ else
|
||||||
#########
|
#########
|
||||||
# ERROR #
|
# ERROR #
|
||||||
#########
|
#########
|
||||||
error "Registry not set correctly!${NC}"
|
error "Registry not set correctly!"
|
||||||
fatal "Registry:[${REGISTRY}]"
|
fatal "Registry:[${REGISTRY}]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ function BuildFileList() {
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# Error
|
# Error
|
||||||
echo "Failed to switch to ${DEFAULT_BRANCH} branch to get files changed!"
|
echo "Failed to switch to ${DEFAULT_BRANCH} branch to get files changed!"
|
||||||
fatal "[${SWITCH_CMD}]${NC}"
|
fatal "[${SWITCH_CMD}]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
################
|
################
|
||||||
|
@ -68,8 +68,8 @@ function BuildFileList() {
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# Error
|
# Error
|
||||||
error "Failed to gain a list of all files changed!${NC}"
|
error "Failed to gain a list of all files changed!"
|
||||||
fatal "[${RAW_FILE_ARRAY[*]}]${NC}"
|
fatal "[${RAW_FILE_ARRAY[*]}]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
################################################
|
################################################
|
||||||
|
@ -525,7 +525,7 @@ function BuildFileList() {
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# Error
|
# Error
|
||||||
error "Failed to switch back to branch!"
|
error "Failed to switch back to branch!"
|
||||||
fatal "[${SWITCH2_CMD}]${NC}"
|
fatal "[${SWITCH2_CMD}]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
################
|
################
|
||||||
|
|
|
@ -474,8 +474,8 @@ GetStandardRules() {
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# ERROR
|
# ERROR
|
||||||
error "Failed to gain list of ENV vars to load!${NC}"
|
error "Failed to gain list of ENV vars to load!"
|
||||||
fatal "[${GET_ENV_ARRAY[*]}]${NC}"
|
fatal "[${GET_ENV_ARRAY[*]}]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
|
@ -690,7 +690,7 @@ GetGitHubVars() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d "${GITHUB_WORKSPACE}" ]; then
|
if [ ! -d "${GITHUB_WORKSPACE}" ]; then
|
||||||
fatal "Provided volume is not a directory!${NC}"
|
fatal "Provided volume is not a directory!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Linting all files in mapped directory:[${DEFAULT_WORKSPACE}]"
|
echo "Linting all files in mapped directory:[${DEFAULT_WORKSPACE}]"
|
||||||
|
@ -709,8 +709,8 @@ GetGitHubVars() {
|
||||||
# Validate we have a value #
|
# Validate we have a value #
|
||||||
############################
|
############################
|
||||||
if [ -z "${GITHUB_SHA}" ]; then
|
if [ -z "${GITHUB_SHA}" ]; then
|
||||||
error "Failed to get [GITHUB_SHA]!${NC}"
|
error "Failed to get [GITHUB_SHA]!"
|
||||||
fatal "[${GITHUB_SHA}]${NC}"
|
fatal "[${GITHUB_SHA}]"
|
||||||
else
|
else
|
||||||
notice "Successfully found:${F[W]}[GITHUB_SHA]${F[B]}, value:${F[W]}[${GITHUB_SHA}]${NC}"
|
notice "Successfully found:${F[W]}[GITHUB_SHA]${F[B]}, value:${F[W]}[${GITHUB_SHA}]${NC}"
|
||||||
fi
|
fi
|
||||||
|
@ -719,8 +719,8 @@ GetGitHubVars() {
|
||||||
# Validate we have a value #
|
# Validate we have a value #
|
||||||
############################
|
############################
|
||||||
if [ -z "${GITHUB_WORKSPACE}" ]; then
|
if [ -z "${GITHUB_WORKSPACE}" ]; then
|
||||||
error "Failed to get [GITHUB_WORKSPACE]!${NC}"
|
error "Failed to get [GITHUB_WORKSPACE]!"
|
||||||
fatal "[${GITHUB_WORKSPACE}]${NC}"
|
fatal "[${GITHUB_WORKSPACE}]"
|
||||||
else
|
else
|
||||||
notice "Successfully found:${F[W]}[GITHUB_WORKSPACE]${F[B]}, value:${F[W]}[${GITHUB_WORKSPACE}]${NC}"
|
notice "Successfully found:${F[W]}[GITHUB_WORKSPACE]${F[B]}, value:${F[W]}[${GITHUB_WORKSPACE}]${NC}"
|
||||||
fi
|
fi
|
||||||
|
@ -729,8 +729,8 @@ GetGitHubVars() {
|
||||||
# Validate we have a value #
|
# Validate we have a value #
|
||||||
############################
|
############################
|
||||||
if [ -z "${GITHUB_EVENT_PATH}" ]; then
|
if [ -z "${GITHUB_EVENT_PATH}" ]; then
|
||||||
error "Failed to get [GITHUB_EVENT_PATH]!${NC}"
|
error "Failed to get [GITHUB_EVENT_PATH]!"
|
||||||
fatal "[${GITHUB_EVENT_PATH}]${NC}"
|
fatal "[${GITHUB_EVENT_PATH}]"
|
||||||
else
|
else
|
||||||
notice "Successfully found:${F[W]}[GITHUB_EVENT_PATH]${F[B]}, value:${F[W]}[${GITHUB_EVENT_PATH}]${F[B]}${NC}"
|
notice "Successfully found:${F[W]}[GITHUB_EVENT_PATH]${F[B]}, value:${F[W]}[${GITHUB_EVENT_PATH}]${F[B]}${NC}"
|
||||||
fi
|
fi
|
||||||
|
@ -748,8 +748,8 @@ GetGitHubVars() {
|
||||||
# Validate we have a value #
|
# Validate we have a value #
|
||||||
############################
|
############################
|
||||||
if [ -z "${GITHUB_ORG}" ]; then
|
if [ -z "${GITHUB_ORG}" ]; then
|
||||||
error "Failed to get [GITHUB_ORG]!${NC}"
|
error "Failed to get [GITHUB_ORG]!"
|
||||||
fatal "[${GITHUB_ORG}]${NC}"
|
fatal "[${GITHUB_ORG}]"
|
||||||
else
|
else
|
||||||
notice "Successfully found:${F[W]}[GITHUB_ORG]${F[B]}, value:${F[W]}[${GITHUB_ORG}]${NC}"
|
notice "Successfully found:${F[W]}[GITHUB_ORG]${F[B]}, value:${F[W]}[${GITHUB_ORG}]${NC}"
|
||||||
fi
|
fi
|
||||||
|
@ -763,8 +763,8 @@ GetGitHubVars() {
|
||||||
# Validate we have a value #
|
# Validate we have a value #
|
||||||
############################
|
############################
|
||||||
if [ -z "${GITHUB_REPO}" ]; then
|
if [ -z "${GITHUB_REPO}" ]; then
|
||||||
error "Failed to get [GITHUB_REPO]!${NC}"
|
error "Failed to get [GITHUB_REPO]!"
|
||||||
fatal "[${GITHUB_REPO}]${NC}"
|
fatal "[${GITHUB_REPO}]"
|
||||||
else
|
else
|
||||||
notice "Successfully found:${F[W]}[GITHUB_REPO]${F[B]}, value:${F[W]}[${GITHUB_REPO}]${NC}"
|
notice "Successfully found:${F[W]}[GITHUB_REPO]${F[B]}, value:${F[W]}[${GITHUB_REPO}]${NC}"
|
||||||
fi
|
fi
|
||||||
|
@ -774,9 +774,9 @@ GetGitHubVars() {
|
||||||
# Validate we have a value #
|
# Validate we have a value #
|
||||||
############################
|
############################
|
||||||
if [ -z "${GITHUB_TOKEN}" ] && [[ ${RUN_LOCAL} == "false" ]]; then
|
if [ -z "${GITHUB_TOKEN}" ] && [[ ${RUN_LOCAL} == "false" ]]; then
|
||||||
error "Failed to get [GITHUB_TOKEN]!${NC}"
|
error "Failed to get [GITHUB_TOKEN]!"
|
||||||
error "[${GITHUB_TOKEN}]${NC}"
|
error "[${GITHUB_TOKEN}]"
|
||||||
error "Please set a [GITHUB_TOKEN] from the main workflow environment to take advantage of multiple status reports!${NC}"
|
error "Please set a [GITHUB_TOKEN] from the main workflow environment to take advantage of multiple status reports!"
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Need to set MULTI_STATUS to false as we cant hit API endpoints without token #
|
# Need to set MULTI_STATUS to false as we cant hit API endpoints without token #
|
||||||
|
@ -799,8 +799,8 @@ GetGitHubVars() {
|
||||||
# Validate we have a value #
|
# Validate we have a value #
|
||||||
############################
|
############################
|
||||||
if [ -z "${GITHUB_REPOSITORY}" ]; then
|
if [ -z "${GITHUB_REPOSITORY}" ]; then
|
||||||
error "Failed to get [GITHUB_REPOSITORY]!${NC}"
|
error "Failed to get [GITHUB_REPOSITORY]!"
|
||||||
fatal "[${GITHUB_REPOSITORY}]${NC}"
|
fatal "[${GITHUB_REPOSITORY}]"
|
||||||
else
|
else
|
||||||
notice "Successfully found:${F[W]}[GITHUB_REPOSITORY]${F[B]}, value:${F[W]}[${GITHUB_REPOSITORY}]${NC}"
|
notice "Successfully found:${F[W]}[GITHUB_REPOSITORY]${F[B]}, value:${F[W]}[${GITHUB_REPOSITORY}]${NC}"
|
||||||
fi
|
fi
|
||||||
|
@ -809,8 +809,8 @@ GetGitHubVars() {
|
||||||
# Validate we have a value #
|
# Validate we have a value #
|
||||||
############################
|
############################
|
||||||
if [ -z "${GITHUB_RUN_ID}" ]; then
|
if [ -z "${GITHUB_RUN_ID}" ]; then
|
||||||
error "Failed to get [GITHUB_RUN_ID]!${NC}"
|
error "Failed to get [GITHUB_RUN_ID]!"
|
||||||
fatal "[${GITHUB_RUN_ID}]${NC}"
|
fatal "[${GITHUB_RUN_ID}]"
|
||||||
else
|
else
|
||||||
notice "Successfully found:${F[W]}[GITHUB_RUN_ID]${F[B]}, value:${F[W]}[${GITHUB_RUN_ID}]${NC}"
|
notice "Successfully found:${F[W]}[GITHUB_RUN_ID]${F[B]}, value:${F[W]}[${GITHUB_RUN_ID}]${NC}"
|
||||||
fi
|
fi
|
||||||
|
@ -844,8 +844,8 @@ function ValidatePowershellModules() {
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# Failed
|
# Failed
|
||||||
error "Failed find module [PSScriptAnalyzer] for [${LINTER_NAME}] in system!${NC}"
|
error "Failed find module [PSScriptAnalyzer] for [${LINTER_NAME}] in system!"
|
||||||
fatal "[PSSA_MODULE ${VALIDATE_PSSA_MODULE}] [PSSA_CMD ${VALIDATE_PSSA_CMD}]${NC}"
|
fatal "[PSSA_MODULE ${VALIDATE_PSSA_MODULE}] [PSSA_CMD ${VALIDATE_PSSA_CMD}]"
|
||||||
else
|
else
|
||||||
# Success
|
# Success
|
||||||
if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then
|
if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then
|
||||||
|
@ -969,7 +969,7 @@ Footer() {
|
||||||
###################
|
###################
|
||||||
# Print the goods #
|
# Print the goods #
|
||||||
###################
|
###################
|
||||||
error "ERRORS FOUND${NC} in ${LANGUAGE}:[${!ERROR_COUNTER}]${NC}"
|
error "ERRORS FOUND${NC} in ${LANGUAGE}:[${!ERROR_COUNTER}]"
|
||||||
|
|
||||||
#########################################
|
#########################################
|
||||||
# Create status API for Failed language #
|
# Create status API for Failed language #
|
||||||
|
@ -1002,7 +1002,7 @@ Footer() {
|
||||||
# Check if error was found
|
# Check if error was found
|
||||||
if [ "${!ERRORS_FOUND_LANGUAGE}" -ne 0 ]; then
|
if [ "${!ERRORS_FOUND_LANGUAGE}" -ne 0 ]; then
|
||||||
# Failed exit
|
# Failed exit
|
||||||
fatal "Exiting with errors found!${NC}"
|
fatal "Exiting with errors found!"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,8 @@ function LintCodebase() {
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# Failed
|
# Failed
|
||||||
error "Failed to find [${LINTER_NAME}] in system!${NC}"
|
error "Failed to find [${LINTER_NAME}] in system!"
|
||||||
fatal "[${VALIDATE_INSTALL_CMD}]${NC}"
|
fatal "[${VALIDATE_INSTALL_CMD}]"
|
||||||
else
|
else
|
||||||
# Success
|
# Success
|
||||||
if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then
|
if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then
|
||||||
|
@ -225,9 +225,9 @@ function LintCodebase() {
|
||||||
#########
|
#########
|
||||||
# Error #
|
# Error #
|
||||||
#########
|
#########
|
||||||
error "Found errors in [${LINTER_NAME}] linter!${NC}"
|
error "Found errors in [${LINTER_NAME}] linter!"
|
||||||
error "[${LINT_CMD}]${NC}"
|
error "[${LINT_CMD}]"
|
||||||
error "Linter CMD:[${LINTER_COMMAND} ${FILE}]${NC}"
|
error "Linter CMD:[${LINTER_COMMAND} ${FILE}]"
|
||||||
# Increment the error count
|
# Increment the error count
|
||||||
(("ERRORS_FOUND_${FILE_TYPE}++"))
|
(("ERRORS_FOUND_${FILE_TYPE}++"))
|
||||||
|
|
||||||
|
@ -301,8 +301,8 @@ function TestCodebase() {
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# Failed
|
# Failed
|
||||||
error "Failed to find [${LINTER_NAME}] in system!${NC}"
|
error "Failed to find [${LINTER_NAME}] in system!"
|
||||||
fatal "[${VALIDATE_INSTALL_CMD}]${NC}"
|
fatal "[${VALIDATE_INSTALL_CMD}]"
|
||||||
else
|
else
|
||||||
# Success
|
# Success
|
||||||
notice "Successfully found binary for ${F[W]}[${LINTER_NAME}]${F[B]} in system location: ${F[W]}[${VALIDATE_INSTALL_CMD}]${NC}"
|
notice "Successfully found binary for ${F[W]}[${LINTER_NAME}]${F[B]} in system location: ${F[W]}[${VALIDATE_INSTALL_CMD}]${NC}"
|
||||||
|
@ -452,9 +452,9 @@ function TestCodebase() {
|
||||||
#########
|
#########
|
||||||
# Error #
|
# Error #
|
||||||
#########
|
#########
|
||||||
error "Found errors in [${LINTER_NAME}] linter!${NC}"
|
error "Found errors in [${LINTER_NAME}] linter!"
|
||||||
error "[${LINT_CMD}]${NC}"
|
error "[${LINT_CMD}]"
|
||||||
error "Linter CMD:[${LINTER_COMMAND} ${FILE}]${NC}"
|
error "Linter CMD:[${LINTER_COMMAND} ${FILE}]"
|
||||||
# Increment the error count
|
# Increment the error count
|
||||||
(("ERRORS_FOUND_${FILE_TYPE}++"))
|
(("ERRORS_FOUND_${FILE_TYPE}++"))
|
||||||
else
|
else
|
||||||
|
@ -480,11 +480,11 @@ function TestCodebase() {
|
||||||
#########
|
#########
|
||||||
# Error #
|
# Error #
|
||||||
#########
|
#########
|
||||||
error "Found errors in [${LINTER_NAME}] linter!${NC}"
|
error "Found errors in [${LINTER_NAME}] linter!"
|
||||||
error "This file should have failed test case!${NC}"
|
error "This file should have failed test case!"
|
||||||
error "Command run:${NC}[\$${LINT_CMD}]${NC}"
|
error "Command run:${NC}[\$${LINT_CMD}]"
|
||||||
error "[${LINT_CMD}]${NC}"
|
error "[${LINT_CMD}]"
|
||||||
error "Linter CMD:[${LINTER_COMMAND} ${FILE}]${NC}"
|
error "Linter CMD:[${LINTER_COMMAND} ${FILE}]"
|
||||||
# Increment the error count
|
# Increment the error count
|
||||||
(("ERRORS_FOUND_${FILE_TYPE}++"))
|
(("ERRORS_FOUND_${FILE_TYPE}++"))
|
||||||
else
|
else
|
||||||
|
@ -655,8 +655,8 @@ function LintAnsibleFiles() {
|
||||||
##############################
|
##############################
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# Failed
|
# Failed
|
||||||
error "Failed to find ${LINTER_NAME} in system!${NC}"
|
error "Failed to find ${LINTER_NAME} in system!"
|
||||||
fatal "[${VALIDATE_INSTALL_CMD}]${NC}"
|
fatal "[${VALIDATE_INSTALL_CMD}]"
|
||||||
else
|
else
|
||||||
# Success
|
# Success
|
||||||
if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then
|
if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then
|
||||||
|
@ -773,8 +773,8 @@ function LintAnsibleFiles() {
|
||||||
#########
|
#########
|
||||||
# Error #
|
# Error #
|
||||||
#########
|
#########
|
||||||
error "Found errors in [${LINTER_NAME}] linter!${NC}"
|
error "Found errors in [${LINTER_NAME}] linter!"
|
||||||
error "[${LINT_CMD}]${NC}"
|
error "[${LINT_CMD}]"
|
||||||
# Increment error count
|
# Increment error count
|
||||||
((ERRORS_FOUND_ANSIBLE++))
|
((ERRORS_FOUND_ANSIBLE++))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue