fix: improve grep portability in deploy-cn-landing.yml

Use -E (ERE) and [[:space:]] instead of \s and \| for POSIX
compliance across different grep implementations.

Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/80f409c9-7f98-443e-9c31-21111194a523

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-11 15:44:37 +00:00 committed by GitHub
parent 9dffe85f22
commit 81962bc4dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -188,7 +188,7 @@ jobs:
# 保留 conf.d 中的全局配置(如 gzip, ssl_params 等)
# 只移除包含 server { 或 proxy_pass 的自定义站点配置
for conf in /etc/nginx/conf.d/*.conf; do
if [ -f "$conf" ] && grep -q "server\s*{" "$conf" 2>/dev/null; then
if [ -f "$conf" ] && grep -qE "server[[:space:]]*\{" "$conf" 2>/dev/null; then
echo " 🗑️ 移除conf.d冲突站点配置: $(basename "$conf")"
sudo rm -f "$conf"
fi
@ -265,7 +265,7 @@ jobs:
# 验证健康端点来自cn-domain.conf而非其他服务
if echo "$HEALTH" | grep -q "cn-landing"; then
echo "✅ 健康端点: 来自cn-domain.conf正确"
elif echo "$HEALTH" | grep -q "relay\|proxy\|mcp"; then
elif echo "$HEALTH" | grep -qE "relay|proxy|mcp"; then
echo "❌ 健康端点: 来自其他服务 — Nginx配置冲突未完全解决"
fi
@ -367,7 +367,7 @@ jobs:
echo "响应: ${HEALTH}"
if echo "$HEALTH" | grep -q "cn-landing"; then
echo "✅ 来自cn-domain.conf正确"
elif echo "$HEALTH" | grep -q "relay\|proxy\|mcp"; then
elif echo "$HEALTH" | grep -qE "relay|proxy|mcp"; then
echo "❌ 来自其他服务 — 存在Nginx配置冲突"
fi