Skip to content

Commit cdb7d6e

Browse files
authored
Update main.yml
1 parent b9695a8 commit cdb7d6e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ jobs:
2323
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
2424
VM_PASSPHRASE: ${{ secrets.VM_PASSPHRASE }}
2525
run: |
26-
# Clear any previously loaded keys
27-
ssh-add -D
26+
# Check if SSH agent is running and start it if not
27+
if [ -z "$SSH_AGENT_PID" ]; then
28+
eval "$(ssh-agent -s)"
29+
fi
2830
# Set up the SSH directory and key
2931
mkdir -p ~/.ssh
3032
echo "$SSH_PRIVATE_KEY" > ~/.ssh/deployment_key
3133
chmod 600 ~/.ssh/deployment_key
32-
eval "$(ssh-agent -s)"
3334
echo "$VM_PASSPHRASE" | ssh-add ~/.ssh/deployment_key
3435
3536
- name: Configure SSH Settings

0 commit comments

Comments
 (0)