From 7f2fdc86b9dd5254260ffb0a2c035f7d6e8c5ecd Mon Sep 17 00:00:00 2001 From: gitea-bot Date: Fri, 31 Jul 2026 08:10:59 +0800 Subject: [PATCH] ci: normalize clone URL host to gitea:3000 (container-reachable) --- .gitea/workflows/ai-review.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ai-review.yml b/.gitea/workflows/ai-review.yml index 8e89541..afb6d30 100644 --- a/.gitea/workflows/ai-review.yml +++ b/.gitea/workflows/ai-review.yml @@ -20,12 +20,13 @@ jobs: - name: 检出代码(兼容 fork PR:克隆 head 仓库) run: | git config --global http.extraHeader "Authorization: Basic $(printf 'oauth2:%s' "$REVIEW_PAT" | base64 -w0)" - git clone "${{ gitea.event.pull_request.head.repo.clone_url }}" . + HEAD_URL=$(echo "${{ gitea.event.pull_request.head.repo.clone_url }}" | sed 's|http://[^/]*/|http://gitea:3000/|') + git clone "$HEAD_URL" . git checkout "${{ gitea.event.pull_request.head.sha }}" - name: 生成 PR diff(从 base 仓库取目标分支做对比) run: | - BASE_REPO="${{ gitea.event.pull_request.base.repo.clone_url }}" + BASE_REPO=$(echo "${{ gitea.event.pull_request.base.repo.clone_url }}" | sed 's|http://[^/]*/|http://gitea:3000/|') BASE_REF="${{ gitea.event.pull_request.base.ref }}" git remote add base "$BASE_REPO" git fetch base "$BASE_REF"