From 84a32023ee60d415ab8efbb3635892bc4649ce07 Mon Sep 17 00:00:00 2001 From: Blizzard Date: Sat, 18 Jul 2026 15:47:33 +0800 Subject: [PATCH] =?UTF-8?q?ci(gitea):=20=E6=A3=80=E5=87=BA=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E4=BB=8E=E5=86=85=E7=BD=91=20Gitea=20=E5=85=8B?= =?UTF-8?q?=E9=9A=86,=E7=BB=95=E5=BC=80=20github.com=20=E6=8B=89=20actions?= =?UTF-8?q?/checkout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 内网 runner 连不上 github.com,actions/checkout@v4 下载 action 时 unexpected EOF。 改用 git init+fetch 从 git.sundynix.cn(同内网必达)拉当前分支,用工作流自带 github.token 认证,不再依赖 github.com。 Co-Authored-By: Claude Opus 4.8 --- .gitea/workflows/deploy.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index dc23599..e5d4ee5 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -16,8 +16,14 @@ jobs: deploy: runs-on: ubuntu-latest # 须匹配 128 上已注册 runner 的标签;不符请改成你的标签 steps: - - name: 检出代码 - uses: actions/checkout@v4 + # 不用 actions/checkout(它要去 github.com 下载 action,内网 runner 连不上会 EOF); + # 直接从内网 Gitea 用工作流自带 token 拉本仓库当前分支。init+fetch 不怕工作目录非空。 + - name: 检出代码(内网 Gitea) + run: | + git init -q . + git remote add origin "https://token:${{ github.token }}@git.sundynix.cn/${{ github.repository }}.git" + git fetch -q --depth 1 origin "${{ github.ref_name }}" + git checkout -q FETCH_HEAD - name: 构建 4 个应用镜像(在 runner 上) run: |