-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
28 lines (28 loc) · 1.07 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: 'Create SSH private-key from secret'
description: 'Takes an input and persists it in the .ssh dir (creates it first; sets permissions) as a private key using the given filename to use later.'
inputs:
key:
description: 'The private key to use when connecting via SSH.'
required: true
key-name:
description: 'Name of the file the private key is temporarily saved in. Defaults to `identity`.'
required: true
default: 'identity'
runs:
using: "composite"
steps:
- name: Setup SSH - make dir .ssh
shell: bash
run: sudo mkdir .ssh
- name: Setup SSH - set .ssh permissions
shell: bash
run: sudo chmod 700 .ssh
- name: Setup SSH - touch .ssh/${{ inputs.key-name }}
shell: bash
run: sudo touch .ssh/${{ inputs.key-name }}
- name: Setup SSH - fill .ssh/${{ inputs.key-name }}
shell: bash
run: sudo echo "${{ inputs.key }}" >> .ssh/${{ inputs.key-name }}
- name: Setup SSH - chmod .ssh/${{ inputs.key-name }}
shell: bash
run: sudo chmod 600 .ssh/${{ inputs.key-name }}