From 1a5de54f882e285532fca437e8f304d6115c09f8 Mon Sep 17 00:00:00 2001 From: "kihwan.song" Date: Tue, 28 Apr 2026 10:31:02 +0900 Subject: [PATCH] =?UTF-8?q?ssh=20=EC=A4=80=EB=B9=84=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=A6=BD=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot --- prepare-ssh/action.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 prepare-ssh/action.yml diff --git a/prepare-ssh/action.yml b/prepare-ssh/action.yml new file mode 100644 index 0000000..9af13dd --- /dev/null +++ b/prepare-ssh/action.yml @@ -0,0 +1,26 @@ +name: SSH 준비 +description: SSH 키를 설정하고 호스트를 known_hosts에 추가하는 스크립트 + +inputs: + ssh-key: + required: true + host: + required: true + key-path: + required: false + default: ~/.ssh/deploy_key + +runs: + using: composite + steps: + - shell: bash + run: | + set -eu + + mkdir -p ~/.ssh + chmod 700 ~/.ssh + + printf '%s\n' "${{ inputs.ssh-key }}" > ${{ inputs.key-path }} + chmod 600 ${{ inputs.key-path }} + + ssh-keyscan -H "${{ inputs.host }}" >> ~/.ssh/known_hosts \ No newline at end of file