Added port and ssl-protect-data true

This commit is contained in:
Yuriy Boev 2021-09-19 22:29:36 +03:00
parent ca3f8d253d
commit 4a45a7fdaa
3 changed files with 34 additions and 28 deletions

View file

@ -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 | '' |

View file

@ -1,35 +1,39 @@
name: 'ftp-action'
author: 'Sebastian Popp <ftp-action@sebastianpopp.com>'
description: 'Automate copying your files via FTP using this GitHub action.'
name: "ftp-action"
author: "Sebastian Popp <ftp-action@sebastianpopp.com>"
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"

View file

@ -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"