This commit is contained in:
1
2026-01-27 07:50:33 +00:00
parent 78a81c1026
commit ec1c39295e

View File

@@ -55,17 +55,20 @@ steps:
# 替换原SSH认证判断代码
- |
ssh_output=$$(ssh -vvv -i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new git@github.com 2>&1)
echo "===== 完整SSH连接日志 ====="
echo "$$ssh_output"
echo "===== SSH日志结束 ====="
if echo "$$ssh_output" | grep -q "successfully authenticated"; then
ssh_output=$(ssh -vvv -i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new git@github.com 2>&1)
echo "===== 完整SSH连接日志 ====="
echo "$ssh_output"
echo "===== SSH日志结束 ====="
if echo "$ssh_output" | grep -q "successfully authenticated"; then
echo "✅ SSH认证成功忽略正常的Exit status 1"
else
echo "❌ SSH认证失败"
exit 1
fi
else
echo "❌ SSH认证失败"
exit 1
fi
#- ssh -vvv -i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new git@github.com 2>&1
# 拉取代码拆分命令添加错误处理避免静默失败
- git init || { echo "❌ git init失败"; exit 1; }