1
This commit is contained in:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user