From 16826b94db5f3c8d324551941d16e13b7be17518 Mon Sep 17 00:00:00 2001 From: JackWhh <5264499+jack_whh@user.noreply.gitee.com> Date: Thu, 18 Jul 2024 09:30:05 +0000 Subject: [PATCH] 1 Signed-off-by: JackWhh <5264499+jack_whh@user.noreply.gitee.com> --- action.yml | 5 ++++- entrypoint.sh | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 7de4635..05c1335 100644 --- a/action.yml +++ b/action.yml @@ -36,7 +36,9 @@ inputs: password: description: "SSH passsword,If a password is set, the secret key pair is ignored" required: false - + script: + description: "upload files after exec script" + required: false runs: using: 'docker' @@ -52,6 +54,7 @@ runs: - ${{ inputs.sftpArgs }} - ${{ inputs.delete_remote_files }} - ${{ inputs.password }} + - ${{ inputs.script }} branding: icon: 'upload-cloud' diff --git a/entrypoint.sh b/entrypoint.sh index 28dc8c1..7d5dcba 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -62,6 +62,8 @@ echo 'SFTP Start' printf "%s" "put -r $5 $6" >$TEMP_SFTP_FILE #-o StrictHostKeyChecking=no avoid Host key verification failed. sftp -b $TEMP_SFTP_FILE -P $3 $8 -o StrictHostKeyChecking=no -i $TEMP_SSH_PRIVATE_KEY_FILE $1@$2 - +if [ -z != ${11} ]; then + ssh -o StrictHostKeyChecking=no -p $3 -i $TEMP_SSH_PRIVATE_KEY_FILE $1@$2 $11 +fi echo 'Deploy Success' exit 0