From 1075d298c879229bc3712780d37a963a4e5fc303 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Wed, 1 May 2024 15:08:12 +0200 Subject: [PATCH] WIP --- action.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 6750497..de3366e 100644 --- a/action.yml +++ b/action.yml @@ -64,6 +64,7 @@ runs: User ${{ inputs.username }} HostName ${{ inputs.host }} Port ${{ inputs.port }} + IdentityFile ~/.ssh/key ForwardAgent no ForwardX11 no PasswordAuthentication no @@ -85,17 +86,22 @@ runs: shell: bash if: ${{ inputs.known-host-content == null }} - - name: Install SSH key run: | echo "Installing SSH key" - echo "${{ inputs.ssh-key }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa + echo "${{ inputs.ssh-key }}" > ~/.ssh/key + chmod 600 ~/.ssh/key shell: bash if: ${{ inputs.ssh-key != null }} - name: Transfer files run: | echo "Transferring files" - rsync ${{ inputs.args }} "${{ inputs.source }}" "targethost:${{ inputs.target }}" + rsync ${{ inputs.args }} "${{ inputs.source }}" --rsh "ssh -F ~/.ssh/config" "targethost:${{ inputs.target }}" + shell: bash + + - name: Cleanup + run: | + echo "Cleaning up" + rm -f ~/.ssh/{config,key,known_hosts} || true shell: bash \ No newline at end of file