From 74a81da54a8f8a7a59b1e03082f4a8b4b9d30298 Mon Sep 17 00:00:00 2001 From: work Date: Thu, 9 Apr 2026 11:51:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E9=A1=B9=E7=9B=AEcd=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/cd.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/cd.yaml b/.gitea/workflows/cd.yaml index ce33088..611b809 100644 --- a/.gitea/workflows/cd.yaml +++ b/.gitea/workflows/cd.yaml @@ -45,13 +45,15 @@ jobs: - name: 更新或clone项目 shell: powershell run: | - if (-not (Test-Path -Path ${{ env.REPOSITORY_URL }}\.git)) { + if (-not (Test-Path -Path "${{ env.DESTINATION }}\.git")) { # 目录不存在,执行 git clone - git clone ${{ env.REPOSITORY_URL }} ${{ env.DESTINATION }} + git clone "${{ env.REPOSITORY_URL }}" "${{ env.DESTINATION }}" } else { - # 目录存在,执行 git pull - Set-Location ${{ env.DESTINATION }} + # 目录存在,更新远程地址并拉取 + Set-Location "${{ env.DESTINATION }}" + # 检查并更新远程地址 + git remote set-url origin "${{ env.REPOSITORY_URL }}" git pull } - name: Set up Python