fix(ci): Flutter 归档解压加 --no-same-owner,并登记 safe.directory
Design System Guard / guard (push) Failing after 5m3s

run 8 实测:1.58GB 归档 3 分钟下完、解压成功,最后卡在
  fatal: detected dubious ownership in repository at '/root/development/flutter'
flutter 工具链启动时会调 git 取版本,被该保护拦下 → exit 128。
根因是归档内 uid 非 0,root 身份解压仍按原 uid 设属主。
解压加 --no-same-owner,并额外 git config --global safe.directory 兜底。
This commit is contained in:
PMon Dev committed 2026-11-09 22:09:48 +08:00
1 parent 30280f3b75
commit 5ba371380f
1 file changed
+7 -1
+7 -1
View File
@@ -82,10 +82,16 @@ jobs:
mkdir -p "$HOME/development"
echo "下载 $URL"
curl -fsSL --retry 3 --retry-delay 5 --connect-timeout 20 -o /tmp/flutter.tar.xz "$URL"
tar xf /tmp/flutter.tar.xz -C "$HOME/development"
# --no-same-owner:归档内的 uid 不是 0,按原 uid 解压会让
# /root/development/flutter 属主≠root,git 2.35+ 随即报
# "fatal: detected dubious ownership",而 flutter 工具链启动时
# 会调用 git 取版本 → 直接 exit 128。run 8 就死在这里。
tar --no-same-owner -xf /tmp/flutter.tar.xz -C "$HOME/development"
rm -f /tmp/flutter.tar.xz
echo "$HOME/development/flutter/bin" >> "$GITHUB_PATH"
echo "FLUTTER_BIN=$HOME/development/flutter/bin/flutter" >> "$GITHUB_ENV"
# 双保险:即便属主仍有偏差,也让 git 认这个目录。
git config --global --add safe.directory "$HOME/development/flutter"
"$HOME/development/flutter/bin/flutter" --version
- name: Run design system guards