From 0d334e893992d01356c47b8bcf9c642c2d3f77b6 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 16 Oct 2026 22:23:00 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E7=A7=BB=E9=99=A4=E8=BF=9C=E7=A8=8B=20ac?= =?UTF-8?q?tion=20=E4=BE=9D=E8=B5=96=EF=BC=8C=E6=94=B9=E7=94=A8=E5=86=85?= =?UTF-8?q?=E7=BD=91=20clone=EF=BC=88github=20=E4=B8=8D=E5=8F=AF=E8=BE=BE?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E6=8C=82=E6=AD=BB=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 9090e2e..62bb006 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,5 +1,8 @@ # CI:每次推送自动运行完整测试套件(本地与云端同一入口:node scripts/ci.mjs) -# 网络适配:服务器在国内,job 容器镜像走腾讯内网镜像源,npm/pnpm 走国内 registry +# 网络适配(服务器在国内): +# 1) 不使用任何远程 action(actions/checkout 会被解析到 github.com 导致挂死),改用内置环境变量手动 clone +# 2) job 容器镜像走腾讯内网镜像源(runner 标签已指向 mirror.ccs.tencentyun.com) +# 3) npm/pnpm 走国内 registry name: CI on: push: @@ -12,8 +15,11 @@ jobs: container: image: mirror.ccs.tencentyun.com/library/node:22-bookworm steps: - - name: 检出代码 - uses: actions/checkout@v4 + - name: 检出代码(内网闭环,不访问 github) + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + git clone --depth 1 "https://x-access-token:${GITHUB_TOKEN}@${GITHUB_SERVER_URL#https://}/root/daywork.git" . + git checkout "$GITHUB_SHA" - name: 安装 pnpm run: npm install -g pnpm@11 --registry=https://registry.npmmirror.com @@ -34,8 +40,11 @@ jobs: image: mirror.ccs.tencentyun.com/library/node:22-bookworm continue-on-error: true steps: - - name: 检出代码 - uses: actions/checkout@v4 + - name: 检出代码(内网闭环,不访问 github) + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + git clone --depth 1 "https://x-access-token:${GITHUB_TOKEN}@${GITHUB_SERVER_URL#https://}/root/daywork.git" . + git checkout "$GITHUB_SHA" - name: 安装 pnpm run: npm install -g pnpm@11 --registry=https://registry.npmmirror.com