From 5082885ace2b6f0fe517efc4ac973a8966d8a25e Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Sun, 4 Jan 2026 00:54:05 -0800 Subject: [PATCH] =?UTF-8?q?ci(workflow):=20=E6=9B=BF=E6=8D=A2=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E7=9A=84=E6=A3=80=E5=87=BA=E6=93=8D=E4=BD=9C=E4=B8=BA?= =?UTF-8?q?=E6=89=8B=E5=8A=A8=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用手动实现的git命令替换actions/checkout,以避免Node.js依赖 --- .gitea/workflows/docker.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/docker.yml b/.gitea/workflows/docker.yml index ad57afb..fb5bee2 100644 --- a/.gitea/workflows/docker.yml +++ b/.gitea/workflows/docker.yml @@ -23,10 +23,19 @@ jobs: build-and-deploy: runs-on: landing-hero-web01 steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 + - name: Manual checkout (no Node required) + run: | + set -e + if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then + git fetch --all --tags + git checkout "${{ github.ref_name }}" + git reset --hard "origin/${{ github.ref_name }}" + else + REPO_URL="${{ github.server_url }}/${{ github.repository }}" + echo "Cloning $REPO_URL" + git clone --depth=1 --branch "${{ github.ref_name }}" "$REPO_URL" . + git fetch --tags + fi - name: Build dist in Node container run: |