diff --git a/remote-command/action.yml b/remote-command/action.yml index f6d26f5..99e9606 100644 --- a/remote-command/action.yml +++ b/remote-command/action.yml @@ -11,7 +11,7 @@ inputs: required: true key-path: required: false - default: ~/.ssh/deploy_key + default: "" command: required: true @@ -22,7 +22,13 @@ runs: run: | set -eu - ssh -p ${{ inputs.port }} -i "${{ inputs.key-path }}" \ + KEY_PATH="${{ inputs.key-path }}" + if [ -z "$KEY_PATH" ]; then + KEY_PATH="$HOME/.ssh/deploy_key" + fi + + ssh -p "${{ inputs.port }}" -i "$KEY_PATH" \ + -o IdentitiesOnly=yes \ "${{ inputs.user }}@${{ inputs.host }}" \ 'bash -se' << 'EOF' ${{ inputs.command }}