From 639188e7fc2bd01f16f1bb459732d81159b247c5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 07:04:22 +0000 Subject: [PATCH] fix: add missing brain file warnings in sync job Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> --- .github/workflows/daily-maintenance.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/daily-maintenance.yml b/.github/workflows/daily-maintenance.yml index 2a4a3b60..59d97f1b 100644 --- a/.github/workflows/daily-maintenance.yml +++ b/.github/workflows/daily-maintenance.yml @@ -165,9 +165,21 @@ jobs: exit 0 fi - HEALTH=$(cat brain/system-health.json 2>/dev/null || echo '{"version":"unknown","system_health":"unknown"}') - AUTO=$(cat brain/automation-map.json 2>/dev/null || echo '{"workflows":[]}') - REPO=$(cat brain/repo-map.json 2>/dev/null || echo '{"directories":{}}') + HEALTH=$(cat brain/system-health.json 2>/dev/null) + if [ -z "$HEALTH" ]; then + echo "⚠️ brain/system-health.json 未找到,使用默认值" + HEALTH='{"version":"unknown","system_health":"unknown"}' + fi + AUTO=$(cat brain/automation-map.json 2>/dev/null) + if [ -z "$AUTO" ]; then + echo "⚠️ brain/automation-map.json 未找到,使用默认值" + AUTO='{"workflows":[]}' + fi + REPO=$(cat brain/repo-map.json 2>/dev/null) + if [ -z "$REPO" ]; then + echo "⚠️ brain/repo-map.json 未找到,使用默认值" + REPO='{"directories":{}}' + fi VERSION=$(echo "$HEALTH" | jq -r '.version // "unknown"') STATUS=$(echo "$HEALTH" | jq -r '.system_health // "unknown"')