diff --git a/README.md b/README.md index 50c4a78..635f8a8 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ jobs: host: ${{ secrets.FTP_SERVER }} user: ${{ secrets.FTP_USERNAME }} password: ${{ secrets.FTP_PASSWORD }} + port: ${{ secrets.FTP_PORT }} localDir: "dist" remoteDir: "www" options: "--delete --asci" @@ -26,12 +27,13 @@ jobs: ## Input parameters -Input parameter | Description | Required | Default ---- | --- | --- | --- -host | FTP server name | Yes | N/A -user | FTP username | Yes | N/A -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 | '' +| Input parameter | Description | Required | Default | +| --------------- | ------------------------------- | -------- | ------- | +| host | FTP server name | Yes | N/A | +| user | FTP username | Yes | N/A | +| password | FTP password | Yes | N/A | +| port | FTP port | No | 21 | +| 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 6d362cb..45b82b6 100644 --- a/action.yml +++ b/action.yml @@ -1,35 +1,39 @@ -name: 'ftp-action' -author: 'Sebastian Popp ' -description: 'Automate copying your files via FTP using this GitHub action.' +name: "ftp-action" +author: "Sebastian Popp " +description: "Automate copying your files via FTP using this GitHub action." inputs: host: - description: 'FTP host' + description: "FTP host" required: true user: - description: 'FTP user' + description: "FTP user" required: true password: - description: 'FTP password' + description: "FTP password" required: true + port: + description: "FTP port" + required: false + default: "21" forceSsl: - description: 'Force SSL encryption' + description: "Force SSL encryption" required: false - default: 'false' + default: "false" localDir: - description: 'Local directory' + description: "Local directory" required: false - default: '.' + default: "." remoteDir: - description: 'Remote directory' + description: "Remote directory" required: false - default: '.' + default: "." options: - description: 'Additional mirror command options' + description: "Additional mirror command options" required: false - default: '' + default: "" runs: - using: 'docker' - image: 'Dockerfile' + using: "docker" + image: "Dockerfile" branding: - color: 'blue' - icon: 'upload-cloud' + color: "blue" + icon: "upload-cloud" diff --git a/entrypoint.sh b/entrypoint.sh index 45331f7..c0abd2e 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 $INPUT_OPTIONS --reverse --continue --dereference -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit" +lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -p $INPUT_PORT -e "set ftp:ssl-force $INPUT_FORCESSL; set ssl:verify-certificate false; set ftp:ssl-protect-data true; mirror $INPUT_OPTIONS --reverse --continue --dereference -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit"