File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 2323 SSH_PRIVATE_KEY : ${{ secrets.SSH_PRIVATE_KEY }}
2424 VM_PASSPHRASE : ${{ secrets.VM_PASSPHRASE }}
2525 run : |
26- # Check if SSH agent is running and start it if not
26+ # Start SSH Agent if it's not already running
2727 if [ -z "$SSH_AGENT_PID" ]; then
2828 eval "$(ssh-agent -s)"
2929 fi
@@ -33,11 +33,13 @@ jobs:
3333 chmod 600 ~/.ssh/deployment_key
3434 echo "$VM_PASSPHRASE" | ssh-add ~/.ssh/deployment_key
3535
36- - name : Create SSH Config File
36+ - name : Ensure SSH Config File Exists
3737 run : |
38- # Create an SSH config file to avoid the "No such file or directory" error
38+ # Ensure the SSH config file exists
3939 mkdir -p ~/.ssh
40- echo -e "Host *\n IdentitiesOnly yes\n StrictHostKeyChecking accept-new\n LogLevel VERBOSE" > ~/.ssh/config
40+ if [ ! -f ~/.ssh/config ]; then
41+ echo -e "Host *\n IdentitiesOnly yes\n StrictHostKeyChecking accept-new\n LogLevel VERBOSE" > ~/.ssh/config
42+ fi
4143 chmod 600 ~/.ssh/config
4244
4345 - name : Add VM to known_hosts
You can’t perform that action at this time.
0 commit comments