SFTP-Deploy-Action
SFTP-Deploy-Action copied to clipboard
sftp_only and delete_remote_files not working together
Is it possible that your server only accepting sftp connection? From what I see here, deleting remote files requires ssh access.
https://github.com/wlixcc/SFTP-Deploy-Action/blob/master/entrypoint.sh#L47-L58
# delete remote files if needed
if test $9 == "true";then
echo 'Start delete remote files'
ssh -o StrictHostKeyChecking=no -p $3 -i $TEMP_SSH_PRIVATE_KEY_FILE $1@$2 rm -rf $6
fi
if test $7 = "true"; then
echo "Connection via sftp protocol only, skip the command to create a directory"
else
echo 'Create directory if needed'
ssh -o StrictHostKeyChecking=no -p $3 -i $TEMP_SSH_PRIVATE_KEY_FILE $1@$2 mkdir -p $6
fi
Yes, that's exactly why I opened this issue
I have the same problem. I only have sftp access but no ssh access to the target server. Anyway, I think the issue is more severe, if delete_remote_files=true and sftp_only=true because the first command checks only if we want to delete the directory, but the second one won't be executed at all. In my opinion, the first command has to check for sftp_only as well.