commit 1a5de54f882e285532fca437e8f304d6115c09f8 Author: kihwan.song Date: Tue Apr 28 10:31:02 2026 +0900 ssh 준비 스크립트 추가 Co-authored-by: Copilot 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