This commit is contained in:
1
2026-01-27 07:11:15 +00:00
parent e4891b567e
commit c3da7c53ce

View File

@@ -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; }