Skip to content

Commit

Permalink
update action - added custom command
Browse files Browse the repository at this point in the history
  • Loading branch information
tomato4 committed Apr 3, 2022
1 parent ca3f8d2 commit d5e53b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ftp-action

Automate copying your files via ftp using this GitHub action.
Automate copying your files via ftp using this GitHub action. This command is fork of sebastianpopp/ftp-action with customizable LFTP command.

## Example usage

Expand All @@ -19,6 +19,7 @@ jobs:
host: ${{ secrets.FTP_SERVER }}
user: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
command: "mirror"
localDir: "dist"
remoteDir: "www"
options: "--delete --asci"
Expand All @@ -31,7 +32,8 @@ Input parameter | Description | Required | Default
host | FTP server name | Yes | N/A
user | FTP username | Yes | N/A
password | FTP password | Yes | N/A
command | LFTP command | No | "mirror"
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 | ''
options | Mirror command options | No | "--reverse --continue --dereference"
10 changes: 7 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'ftp-action'
name: 'lftp-custom-action'
author: 'Sebastian Popp <ftp-action@sebastianpopp.com>'
description: 'Automate copying your files via FTP using this GitHub action.'
description: 'Automate copying your files via FTP using this GitHub action. This command is fork of sebastianpopp/ftp-action'
inputs:
host:
description: 'FTP host'
Expand All @@ -11,6 +11,10 @@ inputs:
password:
description: 'FTP password'
required: true
command:
description: 'Specify LFTP command'
required: false
default: 'mirror'
forceSsl:
description: 'Force SSL encryption'
required: false
Expand All @@ -26,7 +30,7 @@ inputs:
options:
description: 'Additional mirror command options'
required: false
default: ''
default: '--reverse --continue --dereference'
runs:
using: 'docker'
image: 'Dockerfile'
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 -e "set ftp:ssl-force $INPUT_FORCESSL; set ssl:verify-certificate false; $INPUT_COMMAND $INPUT_OPTIONS $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit"

0 comments on commit d5e53b0

Please sign in to comment.