From f64f2708a17dfecd8239cf973ae87679b8493336 Mon Sep 17 00:00:00 2001 From: chenmoyuan1214 Date: Sat, 21 Nov 2026 19:37:43 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E4=BF=AE=20pr-review=20=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=B7=AF=E5=BE=84=E4=B8=8D=E4=B8=80=E8=87=B4=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E3=80=8C(=E6=97=A0=E6=97=A5=E5=BF=97)=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit flutter 步骤在 GC-UI/frontend 下运行,tee 写到 ../flutter-analyze.log(= GC-UI/), 但汇总步骤在仓库根目录读 flutter-analyze.log,永远读不到。 改为统一用 $GITHUB_WORKSPACE 绝对路径;日志缺失时提示「步骤可能未执行」。 --- .github/workflows/pr-review.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml index 4fd1e25..f1a60bf 100644 --- a/.github/workflows/pr-review.yml +++ b/.github/workflows/pr-review.yml @@ -84,8 +84,9 @@ jobs: continue-on-error: true run: | set -o pipefail - dotnet restore GC.sln > dotnet-restore.log 2>&1 - dotnet build GC.sln -c Release --no-restore 2>&1 | tee dotnet-build.log + dotnet restore GC.sln > "$GITHUB_WORKSPACE/dotnet-restore.log" 2>&1 + dotnet build GC.sln -c Release --no-restore 2>&1 \ + | tee "$GITHUB_WORKSPACE/dotnet-build.log" exit ${PIPESTATUS[0]} - id: flutter @@ -94,10 +95,12 @@ jobs: working-directory: GC-UI/frontend run: | set -o pipefail - flutter pub get 2>&1 | tee ../flutter-pubget.log + # 日志统一写到仓库根目录:后面的汇总步骤在根目录读,路径必须一致 + flutter pub get 2>&1 | tee "$GITHUB_WORKSPACE/flutter-pubget.log" # 仓库里已有历史 warning / info,不应该让它们卡住合并; # 只把真正的 error 当失败。 - flutter analyze --no-fatal-infos --no-fatal-warnings 2>&1 | tee ../flutter-analyze.log + flutter analyze --no-fatal-infos --no-fatal-warnings 2>&1 \ + | tee "$GITHUB_WORKSPACE/flutter-analyze.log" exit ${PIPESTATUS[0]} - id: summary @@ -165,10 +168,17 @@ jobs: echo echo '```' echo "== dotnet build(尾部 40 行)==" - tail -40 dotnet-build.log 2>/dev/null || echo "(无日志)" + tail -40 dotnet-build.log 2>/dev/null || echo "(日志缺失:编译步骤可能未执行)" echo echo "== flutter analyze(尾部 40 行)==" - tail -40 flutter-analyze.log 2>/dev/null || echo "(无日志)" + if [ -f flutter-analyze.log ]; then + tail -40 flutter-analyze.log + elif [ -f flutter-pubget.log ]; then + echo "(analyze 未产生日志,pub get 输出如下)" + tail -20 flutter-pubget.log + else + echo "(日志缺失:Flutter 步骤可能未执行)" + fi echo '```' echo echo ""