More shells cript fixes
This commit is contained in:
parent
fd7c104073
commit
6333f32c32
@ -30,7 +30,7 @@ It is recommended to pass all sensitive values through `secrets`
|
||||
|
||||
```yaml
|
||||
name: Copy single file
|
||||
uses: tempersama/rsync-action@2.2
|
||||
uses: tempersama/rsync-action@2.3
|
||||
with:
|
||||
host: ${{ secrets.host }}
|
||||
source: html/
|
||||
|
@ -3,13 +3,14 @@
|
||||
set -e
|
||||
|
||||
# Quick checks for missing parameters
|
||||
rc=0
|
||||
empty() { echo ERROR: $1 is empty }
|
||||
empty() {
|
||||
echo "ERROR: $1 is empty"
|
||||
}
|
||||
|
||||
[[ "$INPUT_HOST" ]] && empty host
|
||||
[[ "$INPUT_SOURCE" ]] && empty source
|
||||
[[ "$INPUT_DESTINATION" ]] && empty destination
|
||||
[[ "$INPUT_USERNME" ]] && empty username
|
||||
[[ "$INPUT_USERNAME" ]] && empty username
|
||||
[[ "$INPUT_KEY" ]] && empty key
|
||||
|
||||
|
||||
@ -21,6 +22,7 @@ chmod 400 key
|
||||
rsync \
|
||||
-a -v \ --stats \
|
||||
-e "ssh -o StrictHostKeyChecking=no -i key" \
|
||||
--port $INPUT_PORT \
|
||||
--port "$INPUT_PORT" \
|
||||
"$INPUT_SOURCE" \
|
||||
"$INPUT_USERNAME"@"$INPUT_HOST":"$INPUT_DESTINATION"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user