Skip to content

Commit ee140ba

Browse files
authored
Create action.yml
1 parent b6d0530 commit ee140ba

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

action.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'Add SSH Private key'
2+
description: 'Connect your GitHub Action workflow to Tailscale'
3+
branding:
4+
icon: 'arrow-right-circle'
5+
color: 'green'
6+
inputs:
7+
private_key:
8+
description: 'SSH Private key'
9+
required: true
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- name: Check Runner OS
14+
if: ${{ runner.os != 'Linux' }}
15+
shell: bash
16+
run: |
17+
echo "::error title=⛔ error hint::Support Linux Only"
18+
exit 1
19+
- name: Start SSH agent with a key
20+
env:
21+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
22+
run: |
23+
mkdir -p ~/.ssh
24+
ssh-keyscan github.com >> ~/.ssh/known_hosts
25+
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
26+
ssh-add - <<< "${{ inputs.private_key }}"
27+
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV

0 commit comments

Comments
 (0)