From 945d8116440e979e13e98df98e065cf50f4cc230 Mon Sep 17 00:00:00 2001 From: Gaurav Nelson Date: Thu, 8 Apr 2021 09:31:08 +1000 Subject: [PATCH] WIP:Do not merge --- .github/workflows/push.yml | 5 +++-- entrypoint.sh | 19 +++++++++++++------ md/dir4/ok4.md | 1 + md/file1.md | 2 +- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 450e78f..f6ddf00 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -17,8 +17,9 @@ jobs: uses: ./ with: # Add a test to restrict the test to just dir4 and dir5. - folder-path: './md/dir4, ./md/dir5' - file-path: './md/AdditionalFileTest1.md, ./md/AdditionalFileTest2.md' + folder-path: 'md/dir4/, md/dir5/' + file-path: 'md/AdditionalFileTest1.md, md/AdditionalFileTest2.md' + check-modified-files-only: 'yes' shellcheck: runs-on: [ubuntu-latest] steps: diff --git a/entrypoint.sh b/entrypoint.sh index 56c217b..2c09f30 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -142,7 +142,7 @@ check_additional_files () { } -if [ -z "$8" ]; then +if [ -z "$4" ]; then FOLDERS="." else handle_dirs @@ -167,16 +167,23 @@ if [ "$CHECK_MODIFIED_FILES" = "yes" ]; then for i in "${FILE_ARRAY[@]}" do + echo "------------------------------> filename is ${i}" if [ "${i##*.}" == "${FILE_EXTENSION#.}" ]; then - FIND_CALL+=("${i}") - COMMAND="${FIND_CALL[*]}" - $COMMAND &>> error.txt || true - unset 'FIND_CALL[${#FIND_CALL[@]}-1]' + echo "------------------------------> File extension match" + echo "------------------------------> filename: ${i##*/}" + if [ $(find ${FOLDERS} -name "${i##*/}" ) ]; then + echo "------------------------------> folders is ${FOLDERS}" + FIND_CALL+=("${i}") + COMMAND="${FIND_CALL[*]}" + echo "------------------------------> Command is ${COMMAND}" + $COMMAND &>> error.txt || true + unset 'FIND_CALL[${#FIND_CALL[@]}-1]' + fi fi done check_additional_files - + check_errors else diff --git a/md/dir4/ok4.md b/md/dir4/ok4.md index 1a5b1ce..808e85f 100644 --- a/md/dir4/ok4.md +++ b/md/dir4/ok4.md @@ -4,3 +4,4 @@ Go to [Ok5](../dir5/ok5.md#test) +This [doesn't exists](#alpha). \ No newline at end of file diff --git a/md/file1.md b/md/file1.md index a8087c8..ee843b1 100644 --- a/md/file1.md +++ b/md/file1.md @@ -13,7 +13,7 @@ This is to test URLencoding. -### Alpha +### Alpha check This [exists](#alpha).