원격 명령어 스크립트 수정

This commit is contained in:
2026-04-30 20:22:10 +09:00
parent 5043daa2e5
commit 61a940e3eb

View File

@@ -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 }}