From c3da7c53cef0d19e2a9488ae93a5d6c3bf619ec4 Mon Sep 17 00:00:00 2001 From: 1 <1@72wo.cn> Date: Tue, 27 Jan 2026 07:11:15 +0000 Subject: [PATCH] 1 --- .woodpecker/my-first-workflow.yaml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.woodpecker/my-first-workflow.yaml b/.woodpecker/my-first-workflow.yaml index 0bd37335d..b5240e62b 100644 --- a/.woodpecker/my-first-workflow.yaml +++ b/.woodpecker/my-first-workflow.yaml @@ -5,13 +5,7 @@ when: - manual branch: main -clone: - git: - image: woodpeckerci/plugin-git - settings: - use-ssh: true - ssh-key-private: - from_secret: WOODPECKER_SSH_KEY +skip_clone: true # 全局配置变量(替换占位符即可使用) variables: @@ -62,7 +56,7 @@ steps: - ssh -vvv -i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new git@github.com 2>&1 # 拉取代码(拆分命令,添加错误处理,避免静默失败) - git init || { echo "❌ git init失败"; exit 1; } - - git remote add origin "$CI_REPO_CLONE_SSH_URL" || { echo "❌ 添加远程仓库失败"; exit 1; } + - git remote add origin "$$CI_REPO_CLONE_SSH_URL" || { echo "❌ 添加远程仓库失败"; exit 1; } - git config core.sshCommand 'ssh -i /root/.ssh/id_ed25519' - git fetch origin "$CI_REPO_DEFAULT_BRANCH" || { echo "❌ git fetch失败"; exit 1; } - git checkout "$CI_REPO_DEFAULT_BRANCH" || { echo "❌ git checkout失败"; exit 1; }