ci: normalize clone URL host to gitea:3000 (container-reachable)
AI Code Review / review (pull_request) Failing after 1s

This commit is contained in:
gitea-bot
2026-07-31 08:10:59 +08:00
parent b8be62d6d0
commit 7f2fdc86b9
+3 -2
View File
@@ -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"