Author SHA1 Message Date
gitea-bot 582b1ffa69 feat: add risky (fork PR test) 2026-07-31 08:09:19 +08:00
2 changed files with 2 additions and 3 deletions
+2 -3
View File
@@ -20,13 +20,12 @@ jobs:
- name: 检出代码(兼容 fork PR:克隆 head 仓库) - name: 检出代码(兼容 fork PR:克隆 head 仓库)
run: | run: |
git config --global http.extraHeader "Authorization: Basic $(printf 'oauth2:%s' "$REVIEW_PAT" | base64 -w0)" git config --global http.extraHeader "Authorization: Basic $(printf 'oauth2:%s' "$REVIEW_PAT" | base64 -w0)"
HEAD_URL=$(echo "${{ gitea.event.pull_request.head.repo.clone_url }}" | sed 's|http://[^/]*/|http://gitea:3000/|') git clone "${{ gitea.event.pull_request.head.repo.clone_url }}" .
git clone "$HEAD_URL" .
git checkout "${{ gitea.event.pull_request.head.sha }}" git checkout "${{ gitea.event.pull_request.head.sha }}"
- name: 生成 PR diff(从 base 仓库取目标分支做对比) - name: 生成 PR diff(从 base 仓库取目标分支做对比)
run: | run: |
BASE_REPO=$(echo "${{ gitea.event.pull_request.base.repo.clone_url }}" | sed 's|http://[^/]*/|http://gitea:3000/|') BASE_REPO="${{ gitea.event.pull_request.base.repo.clone_url }}"
BASE_REF="${{ gitea.event.pull_request.base.ref }}" BASE_REF="${{ gitea.event.pull_request.base.ref }}"
git remote add base "$BASE_REPO" git remote add base "$BASE_REPO"
git fetch base "$BASE_REF" git fetch base "$BASE_REF"
View File