Skip node_modules from finds

This commit is contained in:
Gabo 2020-08-06 19:49:23 -05:00
parent 0e03102b3e
commit a186477c8b
2 changed files with 6 additions and 6 deletions

View file

@ -1261,7 +1261,7 @@ if [ "${VALIDATE_ARM}" == "true" ]; then
###############################################################################
IFS=$'\n'
mapfile -t LIST_FILES < <(find "${GITHUB_WORKSPACE}" -type f -regex ".*\.\(json\)\$" 2>&1)
mapfile -t LIST_FILES < <(find "${GITHUB_WORKSPACE}" -path "*/node_modules" -prune -o -type f -regex ".*\.\(json\)\$" 2>&1)
for FILE in "${LIST_FILES[@]}"; do
if DetectARMFile "${FILE}"; then
FILE_ARRAY_ARM+=("${FILE}")
@ -1303,7 +1303,7 @@ if [ "${VALIDATE_CLOUDFORMATION}" == "true" ]; then
###############################################################################
IFS=$'\n'
mapfile -t LIST_FILES < <(find "${GITHUB_WORKSPACE}" -type f -regex ".*\.\(yml\|yaml\|json\)\$" 2>&1)
mapfile -t LIST_FILES < <(find "${GITHUB_WORKSPACE}" -path "*/node_modules" -prune -o -type f -regex ".*\.\(yml\|yaml\|json\)\$" 2>&1)
for FILE in "${LIST_FILES[@]}"; do
if DetectCloudFormationFile "${FILE}"; then
FILE_ARRAY_CLOUDFORMATION+=("${FILE}")
@ -1557,7 +1557,7 @@ if [ "${VALIDATE_OPENAPI}" == "true" ]; then
###############################################################################
IFS=$'\n'
mapfile -t LIST_FILES < <(find "${GITHUB_WORKSPACE}" -type f -regex ".*\.\(yml\|yaml\|json\)\$" 2>&1)
mapfile -t LIST_FILES < <(find "${GITHUB_WORKSPACE}" -path "*/node_modules" -prune -o -type f -regex ".*\.\(yml\|yaml\|json\)\$" 2>&1)
for FILE in "${LIST_FILES[@]}"; do
if DetectOpenAPIFile "${FILE}"; then
FILE_ARRAY_OPENAPI+=("${FILE}")
@ -1709,7 +1709,7 @@ if [ "${VALIDATE_STATES}" == "true" ]; then
###############################################################################
IFS=$'\n'
mapfile -t LIST_FILES < <(find "${GITHUB_WORKSPACE}" -type f -regex ".*\.\(json\)\$" 2>&1)
mapfile -t LIST_FILES < <(find "${GITHUB_WORKSPACE}" -path "*/node_modules" -prune -o -type f -regex ".*\.\(json\)\$" 2>&1)
for FILE in "${LIST_FILES[@]}"; do
if DetectAWSStatesFIle "${FILE}"; then
FILE_ARRAY_STATES+=("${FILE}")

View file

@ -85,7 +85,7 @@ function LintCodebase() {
#################################
# Get list of all files to lint #
#################################
mapfile -t LIST_FILES < <(find "${GITHUB_WORKSPACE}" -type f -regex "${FILE_EXTENSIONS}" 2>&1)
mapfile -t LIST_FILES < <(find "${GITHUB_WORKSPACE}" -path "*/node_modules" -prune -o -type f -regex "${FILE_EXTENSIONS}" 2>&1)
###########################
# Set IFS back to default #
@ -312,7 +312,7 @@ function TestCodebase() {
#################################
# Get list of all files to lint #
#################################
mapfile -t LIST_FILES < <(find "${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}/${INDVIDUAL_TEST_FOLDER}" -type f -regex "${FILE_EXTENSIONS}" ! -path "${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}/ansible/ghe-initialize/*" | sort 2>&1)
mapfile -t LIST_FILES < <(find "${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}/${INDVIDUAL_TEST_FOLDER}" -path "*/node_modules" -prune -o -type f -regex "${FILE_EXTENSIONS}" ! -path "${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}/ansible/ghe-initialize/*" | sort 2>&1)
########################################
# Prepare context if TAP output format #