forked from zhouruizhe/gmTouringMiniApp
ci: normalize clone URL host to gitea:3000 (container-reachable)
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user