diff --git a/.github/workflows/ssh.yml b/.github/workflows/ssh.yml new file mode 100644 index 00000000..a0e9f7fa --- /dev/null +++ b/.github/workflows/ssh.yml @@ -0,0 +1,30 @@ +name: Set up SSH agent + +on: + workflow_call: + inputs: + config: + required: true + type: string + known-hosts: + required: true + type: string + secrets: + key: + required: true + +env: + SSH_AUTH_SOCK: /tmp/ssh-agent.sock + +jobs: + ssh-agent: + runs-on: ubuntu-latest + + steps: + - name: Set up SSH agent + run: | + ssh-agent -a $SSH_AUTH_SOCK > /dev/null + ssh-add - <<< "${{ secrets.key }}" + mkdir -p ~/.ssh + echo '${{ inputs.config }}' > ~/.ssh/config + echo '${{ inputs.known-hosts }}' > ~/.ssh/known_hosts