From 9e1b915242f7a837dc33e5cde497323ccb546aeb Mon Sep 17 00:00:00 2001 From: SEBASTIAN JN Date: Sat, 9 Sep 2023 13:56:04 -0300 Subject: [PATCH] update action.yml --- action.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index dede05d..050e53b 100644 --- a/action.yml +++ b/action.yml @@ -12,7 +12,7 @@ inputs: USER: description: "An agent, which can be a human or software agent, using a computer or network service." required: true - PASSWORD: + PASSWORD: description: "Password to use if SSH key is not provided." required: false KEY: @@ -44,7 +44,11 @@ runs: shell: bash - name: ✨ Removing old files... run: | - ssh ssh rm -rf "${{ inputs.FOLDER }}"; + if [[ -n "${{ inputs.KEY }}" ]]; then + ssh ssh rm -rf "${{ inputs.FOLDER }}"; + elif [[ -n "${{ inputs.PASSWORD }}" ]]; then + sshpass -p "$(cat ~/.ssh/password.txt)" ssh ${{ inputs.USER }}@${{ inputs.IP }} rm -rf "${{ inputs.FOLDER }}"; + fi shell: bash - name: 💧 deploy to vps... run: |