From ca3f8d253d20ddd6aa658f8cb27fc847fd610882 Mon Sep 17 00:00:00 2001 From: hsimah Date: Sun, 31 Jan 2021 11:42:23 -0800 Subject: [PATCH] Feature/add additional opts (#17) * Update entrypoint.sh * Update action.yml * Update README.md * Update entrypoint.sh * pass through additional mirror options * restore meta-data --- README.md | 2 ++ action.yml | 4 ++++ entrypoint.sh | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 22ae874..50c4a78 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ jobs: password: ${{ secrets.FTP_PASSWORD }} localDir: "dist" remoteDir: "www" + options: "--delete --asci" ``` ## Input parameters @@ -33,3 +34,4 @@ password | FTP password | Yes | N/A localDir | The local directory to copy | No | . remoteDir | The remote directory to copy to | No | . forceSsl | Force SSL encryption | No | false +options | Mirror command options | No | '' diff --git a/action.yml b/action.yml index 86ea246..6d362cb 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,10 @@ inputs: description: 'Remote directory' required: false default: '.' + options: + description: 'Additional mirror command options' + required: false + default: '' runs: using: 'docker' image: 'Dockerfile' diff --git a/entrypoint.sh b/entrypoint.sh index fabd34d..45331f7 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,3 +1,3 @@ #!/bin/sh -l -lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ftp:ssl-force $INPUT_FORCESSL; set ssl:verify-certificate false; mirror --reverse --continue --dereference -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit" +lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ftp:ssl-force $INPUT_FORCESSL; set ssl:verify-certificate false; mirror $INPUT_OPTIONS --reverse --continue --dereference -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit"