From 71b7db498566b6529abab99e153d23f7648a96d6 Mon Sep 17 00:00:00 2001 From: ci-bot Date: Fri, 1 May 2026 14:32:47 -0400 Subject: [PATCH] ci(windows): resolve host gateway at runtime instead of hardcoding 172.17.0.1 Forgejo Runner spawns each job on a per-job custom Docker network whose gateway is not the default bridge (172.17.0.1). Detecting the default route inside the container picks up whatever bridge gateway is in use. --- .forgejo/workflows/ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 98e9350..fbd064e 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -5,7 +5,9 @@ on: workflow_dispatch: env: - WIN_HOST: 172.17.0.1 + # WIN_HOST is the host machine reachable from inside the job container. + # Resolved at runtime to the container's default gateway, since Forgejo Runner + # creates a per-job Docker network whose gateway IP varies between runs. WIN_PORT: 2210 WIN_USER: edr @@ -28,7 +30,13 @@ jobs: - name: Install sshpass run: | apt-get update -qq - apt-get install -y -qq sshpass openssh-client + apt-get install -y -qq sshpass openssh-client iproute2 + + - name: Resolve host gateway + run: | + GW=$(ip route | awk '/default/ {print $3; exit}') + echo "WIN_HOST=$GW" >> "$GITHUB_ENV" + echo "Using host gateway: $GW" - name: Wait for Windows VM SSH env: