From 2571ce69c045e544bf4aae0b98e80fb09771da34 Mon Sep 17 00:00:00 2001 From: "tao.chen" <93983997+taochen-ct@users.noreply.github.com> Date: Wed, 15 Jul 2026 18:48:25 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=8D=A2=20gitea/action-checkout=20?= =?UTF-8?q?=E6=9B=BF=E4=BB=A3=E6=89=8B=E5=86=99=20git=20clone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 上一轮改用 git clone 手写 checkout 是因为 actions/checkout@v4 是 Node 实现, alpine golang-1.25 镜像没装 Node. 但后来发现镜像连 bash 也没有 (alpine 极简镜像, 只剩 sh), run: | 块也会崩. gitea/action-checkout 是 Gitea 官方 Go 实现的 checkout action, 不依赖 Node 也不依赖 bash, 跟 Gitea runner 原生集成. 替换两个 job 的 checkout step. 注意: gitea/action-checkout 只解决 checkout. 后续 run: | 块 (Set GOPROXY / Build / Test / Upload release asset / Notify) 仍 然用 bash, alpine 没 bash 会继续崩. 这是已知遗留, 跑起来再看 是否真崩. 完整修法是给所有 run: | 块加 shell: sh, 但本 commit 先按用户要求只换 checkout, 观察跑结果再决定. Co-Authored-By: Claude --- .github/workflows/build.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50d6c20..5f3275c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,12 +22,7 @@ jobs: runs-on: golang-1.25 steps: - name: Checkout - run: | - # Manual git checkout — actions/checkout needs Node, which the - # alpine golang-1.25 image doesn't have. - # Gitea runner doesn't expose a token for clone in the usual - # way; for a same-network runner the repo URL is enough. - git clone --depth 1 "${{ github.server_url }}/${{ github.repository }}.git" . + uses: gitea/action-checkout@v4 - name: Set GOPROXY run: | @@ -69,10 +64,7 @@ jobs: runs-on: golang-1.25 steps: - name: Checkout - run: | - # Manual git checkout — actions/checkout needs Node, which the - # alpine golang-1.25 image doesn't have. - git clone --depth 1 "${{ github.server_url }}/${{ github.repository }}.git" . + uses: gitea/action-checkout@v4 - name: Set GOPROXY run: |