diff --git a/README.md b/README.md index 561d403..056f277 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,9 @@ Delete files not present in the local folder on the remote folder. Default `"fal ### `exclude` -Ignore file(s) and/or directorie(s). Default `()`. +Ignore file(s) and/or directorie(s). Default `""`. -Fill an array of regex. E.g. `("^logs/", "^README.md")` +Fill an array of regex. E.g. `"'^logs/' '^README.md'"` ### `disable_ssl_certificate_verification` @@ -49,5 +49,5 @@ with: local_source_dir: "dist" dist_target_dir: "www/my-app" delete: "true" - exclude: ("^logs/", "^README.md") + exclude: "'^logs/' '^README.md'" ``` diff --git a/action.yml b/action.yml index 843723d..68e1946 100644 --- a/action.yml +++ b/action.yml @@ -24,7 +24,7 @@ inputs: exclude: description: "Ignore file(s) and/or directorie(s)" required: false - default: () + default: "" disable_ssl_certificate_verification: description: "Disable SSL certificate verification" required: false diff --git a/entrypoint.sh b/entrypoint.sh index 3b2318f..db262b2 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,3 +1,9 @@ #!/bin/sh -l -lftp $INPUT_FTP_HOST -u $INPUT_FTP_USERNAME,$INPUT_FTP_PASSWORD -e "$([ "$INPUT_DISABLE_SSL_CERTIFICATE_VERIFICATION" == true ] && echo "set ssl:verify-certificate false;") mirror --verbose --reverse $([ "$INPUT_DELETE" == true ] && echo "--delete") $INPUT_LOCAL_SOURCE_DIR $INPUT_DIST_TARGET_DIR; exit" \ No newline at end of file +# Construct the exclude commands +for excludedPath in $INPUT_EXCLUDE +do + EXCLUDE="$EXCLUDE --exclude $excludedPath" +done + +lftp $INPUT_FTP_HOST -u $INPUT_FTP_USERNAME,$INPUT_FTP_PASSWORD -e "$([ "$INPUT_DISABLE_SSL_CERTIFICATE_VERIFICATION" == true ] && echo "set ssl:verify-certificate false;") mirror --verbose --reverse $([ "$INPUT_DELETE" == true ] && echo "--delete") $EXCLUDE $INPUT_LOCAL_SOURCE_DIR $INPUT_DIST_TARGET_DIR; exit" \ No newline at end of file