From 160c9f32c8cac7d2a7a5ff0e7342d1532c16de61 Mon Sep 17 00:00:00 2001 From: "tao.chen" <93983997+taochen-ct@users.noreply.github.com> Date: Wed, 15 Jul 2026 18:45:31 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E7=94=A8=20git=20clone=20=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=20actions/checkout=20(alpine=20=E6=97=A0=20Node)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit alpine golang-1.25 镜像没装 Node, actions/checkout@v4 启动失败: Run Checkout OCI runtime exec failed: exec failed: unable to start container process: exec: "node": executable file not found in \$PATH: unknown actions/checkout 是 Node.js 应用, Gitea alpine runner 镜像不 带 Node. 改用 git clone 手写 checkout step: git clone --depth 1 "\${{ github.server_url }}/\${{ github.repository }}.git" . shallow clone (\$depth 1) 减少传输量, \${{ github.server_url }} 自动 填入 Gitea 实例 URL, \${{ github.repository }} 是 owner/repo 路径. 这个 runner 应该跟 Gitea 在同一网络, 仓库公开, 不需要 auth token. 如果将来换 runner 跨网络或者仓库私有, 改成: git clone --depth 1 \\ -c http.extraHeader="Authorization: token \$GITEA_TOKEN" \\ "\${{ github.server_url }}/\${{ github.repository }}.git" . GITEA_TOKEN 走 \${{ secrets.GITHUB_TOKEN }} (Gitea 自动注入). Co-Authored-By: Claude --- .github/workflows/build.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f936826..50d6c20 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,12 @@ jobs: runs-on: golang-1.25 steps: - name: Checkout - uses: actions/checkout@v4 + 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" . - name: Set GOPROXY run: | @@ -64,7 +69,10 @@ jobs: runs-on: golang-1.25 steps: - name: Checkout - uses: actions/checkout@v4 + 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" . - name: Set GOPROXY run: |