fix quotes in SCP commands
This commit is contained in:
11
action.yml
11
action.yml
@@ -1,7 +1,8 @@
|
||||
name: 'Prepare Remote NFS Directories'
|
||||
description: |
|
||||
Creates specified directories on a remote server (NFS mount) via SSH. Optionally prefixes directories
|
||||
with a provided short SHA to isolate deployments. Skips execution if no directories are specified.
|
||||
Creates specified directories on a remote NFS-mounted server via SSH.
|
||||
Optionally prefixes directories with a provided short SHA to isolate deployments.
|
||||
Skips execution if no directories are specified.
|
||||
|
||||
inputs:
|
||||
ssh_host:
|
||||
@@ -16,7 +17,7 @@ inputs:
|
||||
directories:
|
||||
description: |
|
||||
Newline-separated list of local directories to create remotely and copy contents from.
|
||||
Example: |
|
||||
Example:
|
||||
config
|
||||
public/images
|
||||
public/icons
|
||||
@@ -70,11 +71,11 @@ runs:
|
||||
echo "DEBUG: Creating remote directory $REMOTE_DIR"
|
||||
ssh -o StrictHostKeyChecking=no -i "$SSH_KEY_FILE" \
|
||||
"${{ inputs.ssh_user }}@${{ inputs.ssh_host }}" \
|
||||
"mkdir -p \"$REMOTE_DIR\" && chmod -R 755 \"$REMOTE_DIR\""
|
||||
"mkdir -p '$REMOTE_DIR' && chmod -R 755 '$REMOTE_DIR'"
|
||||
|
||||
echo "DEBUG: Copying contents from local '$LOCAL_DIR' to remote '$REMOTE_DIR'"
|
||||
scp -o StrictHostKeyChecking=no -i "$SSH_KEY_FILE" -r "$LOCAL_DIR/"* \
|
||||
"${{ inputs.ssh_user }}@${{ inputs.ssh_host }}:\"$REMOTE_DIR/\"" || echo "DEBUG: No files to copy in '$LOCAL_DIR'"
|
||||
"${{ inputs.ssh_user }}@${{ inputs.ssh_host }}:'$REMOTE_DIR/'" || echo "DEBUG: No files to copy in '$LOCAL_DIR'"
|
||||
|
||||
CREATED_PATHS+="$REMOTE_DIR"$'\n'
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user