diff --git a/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh b/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh index 5a0f32dd..f33f0475 100644 --- a/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh +++ b/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh @@ -87,8 +87,7 @@ CheckGHEProcess() #################################################### # Check to see if the process is alive and running # #################################################### - # shellcheck disable=SC2009 - CHECK_PROCESS_CMD=$(ps -aef |grep "$GHE_APPLY_COMMAND" |grep -v grep 2>&1) + CHECK_PROCESS_CMD=$(pgrep -f "$GHE_APPLY_COMMAND" 2>&1) ####################### # Load the error code # diff --git a/.automation/upload-docker.sh b/.automation/upload-docker.sh index 82659af0..55719d6b 100755 --- a/.automation/upload-docker.sh +++ b/.automation/upload-docker.sh @@ -166,7 +166,7 @@ ValidateInput() ############################## # Get the name of the branch # ############################## - BRANCH_NAME=$(git branch --contains "$GITHUB_SHA" |awk '{print $2}' 2>&1) + BRANCH_NAME=$(git -C "$GITHUB_WORKSPACE" branch --contains "$GITHUB_SHA" |awk '{print $2}' 2>&1) ####################### # Load the error code # @@ -407,8 +407,7 @@ UploadImage() REPO=$(echo "$GET_INFO_CMD" | awk '{print $1}') TAG=$(echo "$GET_INFO_CMD" | awk '{print $2}') IMAGE_ID=$(echo "$GET_INFO_CMD" | awk '{print $3}') - # shellcheck disable=SC2116 - SIZE=$(echo "${GET_INFO_CMD##* }") + SIZE="${GET_INFO_CMD##* }" ################### # Print the goods # diff --git a/lib/linter.sh b/lib/linter.sh index e4d64c3c..0c2287ad 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash -# shellcheck disable=SC1003,SC2016,SC1091 ################################################################################ ################################################################################ @@ -265,8 +264,7 @@ GetLinterVersions() ################### # Get the version # ################### - # shellcheck disable=SC2207 - GET_VERSION_CMD=($("$LINTER" --version 2>&1)) + mapfile -t GET_VERSION_CMD < <("$LINTER" --version 2>&1) ####################### # Load the error code # @@ -357,11 +355,9 @@ GetStandardRules() # Only env vars that are marked as true GET_ENV_ARRAY=() if [[ "$LINTER" == "javascript" ]]; then - # shellcheck disable=SC2207 - GET_ENV_ARRAY=($(yq .env "$JAVASCRIPT_LINTER_RULES" |grep true)) + mapfile -t GET_ENV_ARRAY < <(yq .env "$JAVASCRIPT_LINTER_RULES" | grep true) elif [[ "$LINTER" == "typescript" ]]; then - # shellcheck disable=SC2207 - GET_ENV_ARRAY=($(yq .env "$TYPESCRIPT_LINTER_RULES" |grep true)) + mapfile -t GET_ENV_ARRAY < <(yq .env "$TYPESCRIPT_LINTER_RULES" | grep true) fi ####################### @@ -612,8 +608,7 @@ GetGitHubVars() ###################### # Get the GitHub Org # ###################### - # shellcheck disable=SC2002 - GITHUB_ORG=$(cat "$GITHUB_EVENT_PATH" | jq -r '.repository.owner.login' ) + GITHUB_ORG=$(jq -r '.repository.owner.login' < "$GITHUB_EVENT_PATH" ) ############################ # Validate we have a value # @@ -629,8 +624,7 @@ GetGitHubVars() ####################### # Get the GitHub Repo # ####################### - # shellcheck disable=SC2002 - GITHUB_REPO=$(cat "$GITHUB_EVENT_PATH"| jq -r '.repository.name' ) + GITHUB_REPO=$(jq -r '.repository.name' < "$GITHUB_EVENT_PATH" ) ############################ # Validate we have a value #