Skip to content

Commit a8c189c

Browse files
committed
Avoid appending duplicated known_hosts
1 parent ecfdb18 commit a8c189c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ jobs:
5555
5656
- name: Add remote server to known_hosts
5757
run: |
58-
ssh-keyscan ${{ env.SSH_HOST }} >> ~/.ssh/known_hosts
58+
if ! grep -q "${{ env.SSH_HOST }}" ~/.ssh/known_hosts; then
59+
ssh-keyscan ${{ env.SSH_HOST }} >> ~/.ssh/known_hosts
60+
fi
5961
6062
- name: Copy the published app to the server
6163
run: |

0 commit comments

Comments
 (0)