diff --git a/tests/scripts/git_change_docs.sh b/tests/scripts/git_change_docs.sh index e623b5d92511..130f5ebe9f5c 100755 --- a/tests/scripts/git_change_docs.sh +++ b/tests/scripts/git_change_docs.sh @@ -19,6 +19,7 @@ set -eux +FOUND_ONE_FILE=0 DOCS_DIR=0 OTHER_DIR=0 DOC_DIR="docs/" @@ -26,6 +27,7 @@ DOC_DIR="docs/" changed_files=`git diff --no-commit-id --name-only -r origin/main` for file in $changed_files; do + FOUND_ONE_FILE=1 if grep -q "$DOC_DIR" <<< "$file"; then DOCS_DIR=1 else @@ -34,9 +36,8 @@ for file in $changed_files; do fi done -if [ ${OTHER_DIR} -eq 1 ]; then +if [ ${FOUND_ONE_FILE} -eq 0 -o ${OTHER_DIR} -eq 1 ]; then exit 0 else exit 1 fi -