fix quotes in SCP commands

This commit is contained in:
Radosław Kukuczka
2025-03-30 12:34:33 +02:00
parent 3338ad6b87
commit ed7e3b721f

View File

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