Skip to content

Commit 1045149

Browse files
authored
remote-copy.yml: Make the targets intermediate directories without --mkpath (#13)
1 parent c35174f commit 1045149

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/remote-copy.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,14 @@ jobs:
187187
# and then one locally on the runner to copy the list of files from the remote.
188188
run: |
189189
ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} -i ${{ steps.ssh.outputs.private-key-path }} /bin/bash <<'EOT'
190+
191+
# Create intermediate directories since we can't use `rsync`s `--mkpath` on some deployment targets
192+
if [ -d "${{ inputs.source }}" ]; then
193+
mkdir -p "${{ inputs.target }}"
194+
else # we can assume we are transferring a file
195+
mkdir -p $(dirname "${{ inputs.target }}")
196+
fi
197+
190198
rsync --recursive --out-format="${{ inputs.target }}/%n" \
191199
${{ ! inputs.overwrite-target && '--ignore-existing' || '--update' }} \
192200
${{ inputs.source }} ${{ inputs.target }} \

0 commit comments

Comments
 (0)