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'
|
name: 'Prepare Remote NFS Directories'
|
||||||
description: |
|
description: |
|
||||||
Creates specified directories on a remote server (NFS mount) via SSH. Optionally prefixes directories
|
Creates specified directories on a remote NFS-mounted server via SSH.
|
||||||
with a provided short SHA to isolate deployments. Skips execution if no directories are specified.
|
Optionally prefixes directories with a provided short SHA to isolate deployments.
|
||||||
|
Skips execution if no directories are specified.
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
ssh_host:
|
ssh_host:
|
||||||
@@ -16,7 +17,7 @@ inputs:
|
|||||||
directories:
|
directories:
|
||||||
description: |
|
description: |
|
||||||
Newline-separated list of local directories to create remotely and copy contents from.
|
Newline-separated list of local directories to create remotely and copy contents from.
|
||||||
Example: |
|
Example:
|
||||||
config
|
config
|
||||||
public/images
|
public/images
|
||||||
public/icons
|
public/icons
|
||||||
@@ -70,11 +71,11 @@ runs:
|
|||||||
echo "DEBUG: Creating remote directory $REMOTE_DIR"
|
echo "DEBUG: Creating remote directory $REMOTE_DIR"
|
||||||
ssh -o StrictHostKeyChecking=no -i "$SSH_KEY_FILE" \
|
ssh -o StrictHostKeyChecking=no -i "$SSH_KEY_FILE" \
|
||||||
"${{ inputs.ssh_user }}@${{ inputs.ssh_host }}" \
|
"${{ 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'"
|
echo "DEBUG: Copying contents from local '$LOCAL_DIR' to remote '$REMOTE_DIR'"
|
||||||
scp -o StrictHostKeyChecking=no -i "$SSH_KEY_FILE" -r "$LOCAL_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'
|
CREATED_PATHS+="$REMOTE_DIR"$'\n'
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user