1
This commit is contained in:
@@ -53,14 +53,18 @@ steps:
|
||||
- ssh-keygen -lf /root/.ssh/id_ed25519 || { echo "❌ SSH密钥解析失败"; exit 1; }
|
||||
- echo "🔍 尝试SSH连接GitHub(详细日志)..."
|
||||
|
||||
# 替换原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
|
||||
echo "✅ SSH认证成功(忽略正常的Exit status 1)"
|
||||
echo "✅ SSH认证成功(忽略正常的Exit status 1)"
|
||||
else
|
||||
echo "❌ SSH认证失败,日志:"
|
||||
echo "$ssh_output"
|
||||
exit 1 # 仅在真失败时终止流程
|
||||
echo "❌ SSH认证失败!"
|
||||
exit 1
|
||||
fi
|
||||
#- ssh -vvv -i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new git@github.com 2>&1
|
||||
# 拉取代码(拆分命令,添加错误处理,避免静默失败)
|
||||
|
||||
Reference in New Issue
Block a user