From c72c45f47be2713116abff8ca9bd8eac9d6d6c63 Mon Sep 17 00:00:00 2001 From: Kumi Date: Mon, 22 Apr 2024 17:06:21 +0200 Subject: [PATCH] feat(workflows): ensure SSH dir exists before scanning host Preemptively creating the `~/.ssh` directory before attempting to add the SSH server's host key to `known_hosts`. This change prevents potential failures in CI workflows where the `.ssh` directory might not exist on a fresh runner environment, ensuring a smoother and more reliable setup for SSH connections. This adjustment enhances the resilience of the testing workflow by avoiding errors related to missing directories, thereby improving automated testing reliability and efficiency. --- .forgejo/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml index 18ea4fc..c5457e9 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -36,6 +36,7 @@ jobs: - name: Trust SSH server's host key (to prevent interactive prompt) run: | + mkdir -p ~/.ssh ssh-keyscan -p 2222 -H localhost >> ~/.ssh/known_hosts - name: Connect to SSH server using SSH key