From 90602b358fb1d54212d9b884b18baf8636315037 Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Wed, 22 Jul 2026 21:18:23 -0700 Subject: [PATCH] ci: accept new key --- .gitea/workflows/build.yaml | 12 ++++-------- .gitea/workflows/submodule.yaml | 8 ++------ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 6c71d32..8f9b673 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -26,14 +26,10 @@ jobs: chmod 600 ~/.ssh/id_ed25519 echo ">>> chmod public key" chmod 600 ~/.ssh/id_ed25519.pub - echo ">>> dns resolve" - nslookup focs.gc.sjtu.edu.cn || host focs.gc.sjtu.edu.cn || echo "DNS failed" - echo ">>> tcp test" - timeout 5 bash -c "echo >/dev/tcp/focs.gc.sjtu.edu.cn/2222" 2>&1 || echo "TCP failed" echo ">>> ssh-keyscan" - timeout 10 ssh-keyscan -p 2222 focs.gc.sjtu.edu.cn >> ~/.ssh/known_hosts || echo "ssh-keyscan failed" + timeout 10 ssh-keyscan -p 2222 focs.gc.sjtu.edu.cn >> ~/.ssh/known_hosts || echo "ssh-keyscan failed, using StrictHostKeyChecking=accept-new" echo ">>> ssh test" - ssh -T git@focs.gc.sjtu.edu.cn -p 2222 + ssh -o StrictHostKeyChecking=accept-new -T git@focs.gc.sjtu.edu.cn -p 2222 # - name: Lint # run: make lint - name: Build @@ -62,9 +58,9 @@ jobs: echo ">>> chmod public key" chmod 600 ~/.ssh/id_ed25519.pub echo ">>> ssh-keyscan" - ssh-keyscan -p 2222 focs.gc.sjtu.edu.cn >> ~/.ssh/known_hosts + timeout 10 ssh-keyscan -p 2222 focs.gc.sjtu.edu.cn >> ~/.ssh/known_hosts || echo "ssh-keyscan failed, using StrictHostKeyChecking=accept-new" echo ">>> ssh test" - ssh -T git@focs.gc.sjtu.edu.cn -p 2222 + ssh -o StrictHostKeyChecking=accept-new -T git@focs.gc.sjtu.edu.cn -p 2222 - name: Set up Git run: | git config --global user.name "bot-joj" diff --git a/.gitea/workflows/submodule.yaml b/.gitea/workflows/submodule.yaml index dba8c2b..28da2bb 100644 --- a/.gitea/workflows/submodule.yaml +++ b/.gitea/workflows/submodule.yaml @@ -23,14 +23,10 @@ jobs: chmod 600 ~/.ssh/id_ed25519 echo ">>> chmod public key" chmod 600 ~/.ssh/id_ed25519.pub - echo ">>> dns resolve" - nslookup focs.gc.sjtu.edu.cn || host focs.gc.sjtu.edu.cn || echo "DNS failed" - echo ">>> tcp test" - timeout 5 bash -c "echo >/dev/tcp/focs.gc.sjtu.edu.cn/2222" 2>&1 || echo "TCP failed" echo ">>> ssh-keyscan" - timeout 10 ssh-keyscan -p 2222 focs.gc.sjtu.edu.cn >> ~/.ssh/known_hosts || echo "ssh-keyscan failed" + timeout 10 ssh-keyscan -p 2222 focs.gc.sjtu.edu.cn >> ~/.ssh/known_hosts || echo "ssh-keyscan failed, using StrictHostKeyChecking=accept-new" echo ">>> ssh test" - ssh -T git@focs.gc.sjtu.edu.cn -p 2222 + ssh -o StrictHostKeyChecking=accept-new -T git@focs.gc.sjtu.edu.cn -p 2222 - name: Set up Git run: | git config --global user.name "bot-joj"