From f0ffa62f520d2d523d0ae35531309301b6776a63 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Sat, 6 Jun 2026 14:18:03 +0800 Subject: [PATCH] fix(ci): verify deployed version from package.json --- .github/workflows/deploy.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 229ada9..8e428de 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -228,8 +228,11 @@ jobs: fi # Verify the installed version matches the requested version. - INSTALLED="$(npm ls -g "${PLUGIN_NAME}" --depth=0 2>/dev/null \ - | awk -F'[@:]' '/'"${PLUGIN_NAME}"'@/ {print $2; exit}' || true)" + GLOBAL_ROOT="$(npm root -g)" + INSTALLED="" + if [ -f "${GLOBAL_ROOT}/${PLUGIN_NAME}/package.json" ]; then + INSTALLED="$(node -p "require('${GLOBAL_ROOT}/${PLUGIN_NAME}/package.json').version")" + fi if [ "${INSTALLED}" != "${VERSION}" ]; then echo "::remote-error::Verification failed: expected ${VERSION}, found ${INSTALLED:-}" exit 1