Skip to content

Commit ee1f6fb

Browse files
author
josephkevinmachado
committed
2024-05-15-10-37-mac-m1-actions
1 parent d09d785 commit ee1f6fb

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
name: Test on macOS M1
1+
name: Interactive SSH Access
22

33
on:
4-
push:
5-
pull_request:
64
workflow_dispatch:
75

8-
96
jobs:
107
setup-ssh:
118
runs-on: macos-12
@@ -30,19 +27,20 @@ jobs:
3027
run: sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
3128

3229
- name: Generate SSH key
33-
run: |
34-
ssh-keygen -t rsa -b 4096 -f ./id_rsa -N ""
35-
cat ./id_rsa.pub >> ~/.ssh/authorized_keys
3630
id: ssh-key
31+
run: |
32+
ssh-keygen -t rsa -b 4096 -f $HOME/.ssh/id_rsa -N ""
33+
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
34+
echo "Private key for SSH access:"
35+
cat $HOME/.ssh/id_rsa
3736
3837
- name: Display SSH connection info
3938
run: |
40-
echo "Connect with the following command:"
41-
echo "ssh -i ./id_rsa $(whoami)@$(hostname)"
42-
env:
43-
SSH_KEY: ${{ steps.ssh-key.outputs.ssh-key }}
39+
echo "Use the following command to connect to the runner via SSH:"
40+
echo "ssh -i $HOME/.ssh/id_rsa $(whoami)@$(hostname)"
4441
4542
- name: Keep runner alive for 30 minutes
4643
run: |
4744
echo "Runner will stay alive for 30 minutes. Connect using SSH."
4845
sleep 1800
46+

0 commit comments

Comments
 (0)