Skip to content

Commit fe0cb9c

Browse files
authored
Update main.yml
1 parent 9351bdf commit fe0cb9c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
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

0 commit comments

Comments
 (0)