From f40dae5a03ef64efc30bb306f765e489fdf73af6 Mon Sep 17 00:00:00 2001 From: adtpdn Date: Fri, 3 Jul 2026 18:02:08 +0800 Subject: [PATCH] chore(ci): remap port 222 to port 22 via git config --- .gitea/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index bbce4c0..88b162a 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -26,9 +26,14 @@ jobs: run: | mkdir -p ~/.ssh ssh-keyscan -p 22 172.18.0.2 >> ~/.ssh/known_hosts || true - # Direct IP routing avoids dns completely + # Direct IP routing avoids dns completely. The API returns SSH_PORT=222 but internally Gitea listens on 22. + # So we MUST map any connection to the internal port 22. printf "Host gitea\n HostName 172.18.0.2\n Port 22\n StrictHostKeyChecking no\n" > ~/.ssh/config printf "Host thunderobot\n HostName 172.18.0.2\n Port 22\n StrictHostKeyChecking no\n" >> ~/.ssh/config + + # Force checkout to use the mapped config + git config --global url."ssh://git@gitea/".insteadOf "ssh://git@gitea:222/" + git config --global url."ssh://git@gitea/".insteadOf "git@gitea:222:" chmod 600 ~/.ssh/config - name: Checkout Code