ci: 换 gitea/action-checkout 替代手写 git clone
上一轮改用 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 <noreply@anthropic.com>
This commit is contained in:
@@ -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: |
|
||||
|
||||
Reference in New Issue
Block a user