From 2fe7c6809ca803b8a8e5bb491951aac03f077d53 Mon Sep 17 00:00:00 2001 From: Lyda <1829913225@qq.com> Date: Thu, 18 Sep 2025 18:35:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0.pnpm-store=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E7=8A=B6=E6=80=81=E5=92=8CGit=E8=B7=9F=E8=B8=AA?= =?UTF-8?q?=E8=AF=8A=E6=96=AD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- npm-install/action.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/npm-install/action.yml b/npm-install/action.yml index 4947fe7..6558718 100644 --- a/npm-install/action.yml +++ b/npm-install/action.yml @@ -312,3 +312,22 @@ runs: echo " - 强制安装: ${{ inputs.force-install }}" echo " - Git Stash: ${{ inputs.enable-git-stash }}" fi + # 诊断工作目录是否存在 .pnpm-store 以及其 Git 状态 + echo "\n🧪 目录状态自检:" + echo " - PNPM_STORE_DIR: ${PNPM_STORE_DIR:-}" + if [[ -d ".pnpm-store" ]]; then + echo " - 工作目录存在 .pnpm-store 目录" + if git rev-parse --git-dir >/dev/null 2>&1; then + if git ls-files --error-unmatch .pnpm-store >/dev/null 2>&1; then + echo " - Git 状态: 已被跟踪 (tracked)" + elif git check-ignore -q .pnpm-store; then + echo " - Git 状态: 被忽略 (ignored)" + else + echo " - Git 状态: 未跟踪 (untracked)" + fi + else + echo " - Git 仓库: 未检测到 (非 Git 工作目录)" + fi + else + echo " - 工作目录未发现 .pnpm-store 目录 ✅" + fi