From c452df8988357ad5b3b65d625d786e809c425ecb Mon Sep 17 00:00:00 2001 From: "soroush.asadi" Date: Thu, 28 May 2026 11:59:45 +0330 Subject: [PATCH] fix(ci): add --add-host=gitea:host-gateway to all container jobs github.server_url returns 'http://gitea:3000' (Gitea ROOT_URL using Docker service name). CI job containers run on an isolated network and can't resolve the 'gitea' hostname. host-gateway maps to the Docker bridge IP (172.17.0.1). Gitea publishes port 3000 on all interfaces, so http://gitea:3000 becomes reachable inside every job container via the bridge. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/ci-cd.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index 682056e..222f928 100644 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -45,6 +45,9 @@ jobs: runs-on: ubuntu-latest container: image: mcr.microsoft.com/dotnet/sdk:10.0 + # host-gateway → docker bridge IP (172.17.0.1); Gitea port 3000 is + # published there, so 'gitea' hostname resolves from inside the job container + options: --add-host=gitea:host-gateway services: postgres: image: postgres:16-alpine @@ -94,6 +97,7 @@ jobs: runs-on: ubuntu-latest container: image: mcr.microsoft.com/dotnet/sdk:10.0 + options: --add-host=gitea:host-gateway steps: - name: Checkout env: @@ -118,6 +122,7 @@ jobs: runs-on: ubuntu-latest container: image: node:20-alpine + options: --add-host=gitea:host-gateway steps: - name: Checkout env: @@ -147,6 +152,7 @@ jobs: runs-on: ubuntu-latest container: image: node:20-alpine + options: --add-host=gitea:host-gateway steps: - name: Checkout env: @@ -176,6 +182,7 @@ jobs: runs-on: ubuntu-latest container: image: node:20-alpine + options: --add-host=gitea:host-gateway steps: - name: Checkout env: @@ -205,6 +212,7 @@ jobs: runs-on: ubuntu-latest container: image: node:20-alpine + options: --add-host=gitea:host-gateway steps: - name: Checkout env: