This commit is contained in:
1
2026-01-27 06:17:13 +00:00
parent 6882bcb3f5
commit 4078511183

View File

@@ -33,14 +33,19 @@ steps:
# ========== 关键修改SSH密钥写入逻辑核心修复 ==========
# 替换原echo命令用cat+EOF保留密钥原始换行避免格式损坏
- |
if [ -n "$WOODPECKER_SSH_KEY" ]; then
# 写入ED25519密钥保留原始格式单引号EOF避免转义
cat > /root/.ssh/id_ed25519 << 'EOF'
cat > /root/.ssh/id_ed25519 << EOF
$WOODPECKER_SSH_KEY
EOF
chmod 600 /root/.ssh/id_ed25519
chmod 600 /root/.ssh/id_ed25519
echo "✅ ED25519密钥写入完成"
fi
else
echo "⚠️ WOODPECKER_SSH_KEY变量为空未写入SSH密钥"
fi