Add action
This commit is contained in:
21
action.yaml
Normal file
21
action.yaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
name: SSH
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
ssh-private-key:
|
||||||
|
required: true
|
||||||
|
ssh-known-hosts:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: Setup ssh
|
||||||
|
env:
|
||||||
|
SSH_PRIVATE_KEY: ${{ inputs.ssh-private-key }}
|
||||||
|
SSH_KNOWN_HOSTS: ${{ inputs.ssh-known-hosts }}
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
chmod 700 ~/.ssh
|
||||||
|
echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
|
||||||
|
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
|
||||||
|
chmod 600 ~/.ssh/id_rsa
|
||||||
Reference in New Issue
Block a user