From ffac513b4a5e2f6a34024595a63a32be4aac7eb0 Mon Sep 17 00:00:00 2001 From: gouki Date: Sun, 9 Aug 2026 17:52:50 +0000 Subject: [PATCH] =?UTF-8?q?fix(ci):=20checkout=20=E6=94=B9=E7=94=A8=20gite?= =?UTF-8?q?a.*=20=E8=A1=A8=E8=BE=BE=E5=BC=8F=E4=BC=A0=E5=8F=82=EF=BC=88run?= =?UTF-8?q?ner=20=E6=9C=AA=E6=B3=A8=E5=85=A5=20GITEA=5F*=20=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/miniapp-preview.yml | 7 +++++-- .gitea/workflows/server-deploy.yml | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/miniapp-preview.yml b/.gitea/workflows/miniapp-preview.yml index a6998ba..f25c207 100644 --- a/.gitea/workflows/miniapp-preview.yml +++ b/.gitea/workflows/miniapp-preview.yml @@ -16,10 +16,13 @@ jobs: steps: # 精简 runner(Alpine)无 node,无法跑 action-checkout;直接用 git 浅克隆 - name: Checkout + env: + REPO_URL: ${{ gitea.server_url }}/${{ gitea.repository }} + REF_NAME: ${{ gitea.ref_name }} run: | git init -q . - git remote add origin "$GITEA_SERVER_URL/$GITEA_REPOSITORY" - git fetch -q --depth 20 origin "$GITEA_REF_NAME" + git remote add origin "$REPO_URL" + git fetch -q --depth 20 origin "$REF_NAME" git checkout -q FETCH_HEAD git log --oneline -3 diff --git a/.gitea/workflows/server-deploy.yml b/.gitea/workflows/server-deploy.yml index e7506c6..c8dba7c 100644 --- a/.gitea/workflows/server-deploy.yml +++ b/.gitea/workflows/server-deploy.yml @@ -13,12 +13,15 @@ jobs: # 标准标签:hk / bt-runner 均带 ubuntu-latest,任一空闲 runner 接单 runs-on: ubuntu-latest steps: - # hk 等精简 runner(Alpine)无 node,无法跑 action-checkout;直接用 git 浅克隆 + # 精简 runner(Alpine)无 node,无法跑 action-checkout;直接用 git 浅克隆 - name: Checkout + env: + REPO_URL: ${{ gitea.server_url }}/${{ gitea.repository }} + REF_NAME: ${{ gitea.ref_name }} run: | git init -q . - git remote add origin "$GITEA_SERVER_URL/$GITEA_REPOSITORY" - git fetch -q --depth 20 origin "$GITEA_REF_NAME" + git remote add origin "$REPO_URL" + git fetch -q --depth 20 origin "$REF_NAME" git checkout -q FETCH_HEAD git log --oneline -3