fix: 修复企业微信通知环境变量展开问题
ci/woodpecker/push/woodpecker Pipeline failed

- 使用 PAYLOAD=$(cat <<ENDPAYLOAD) 替代 cat > file <<EOF
- 确保环境变量在 heredoc 中正确展开
- 添加测试脚本验证环境变量展开
- 修复构建详情链接和消息内容缺失问题
This commit is contained in:
张翔
2026-03-28 22:48:22 +08:00
parent 5a27d2fc2a
commit dd2a0999bb
35 changed files with 2728 additions and 915 deletions
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
echo "=== 测试 Webhook Header 传递 ==="
echo ""
echo "1. 检查 Forgejo 发送的 Webhook Header..."
echo ""
echo "2. 创建测试 Webhook 接收器..."
cat > /tmp/test-webhook.sh << 'EOF'
#!/bin/bash
echo "Received webhook at $(date)"
echo "Headers:"
for header in "$@"; do
echo " $header"
done
echo "Body:"
cat
echo ""
EOF
chmod +x /tmp/test-webhook.sh
echo "3. 测试 Nginx 配置..."
docker exec novalon-nginx nginx -T 2>&1 | grep -A 20 "location /api/" | head -25
echo ""
echo "4. 检查最近的 webhook 请求..."
docker logs woodpecker-server 2>&1 | grep "POST /api/hook" | tail -3
echo ""
echo "5. 检查 webhook 解析日志..."
docker logs woodpecker-server 2>&1 | grep "unsupported hook type" | tail -3