diff --git a/action.yml b/action.yml index 6750497..34efd79 100644 --- a/action.yml +++ b/action.yml @@ -59,15 +59,17 @@ runs: - name: Install SSH config run: | echo "Installing SSH config" - echo < ~/.ssh/config + cat < ~/.ssh/config Host targethost User ${{ inputs.username }} HostName ${{ inputs.host }} Port ${{ inputs.port }} + IdentityFile ~/.ssh/key ForwardAgent no ForwardX11 no PasswordAuthentication no EOF + chmod 600 ~/.ssh/config shell: bash - name: Install SSH known_hosts @@ -85,17 +87,24 @@ 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 }}" - shell: bash \ No newline at end of file + ls -lah ~/.ssh + cat ~/.ssh/config + 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