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