From 6b4bd89161fab06be52f72a818796db14e7e6e61 Mon Sep 17 00:00:00 2001 From: marherb <1014287974@qq.com> Date: Sun, 5 May 2024 00:48:54 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=8E=20ci(workflow):=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 554b522..4418d56 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,12 +25,12 @@ jobs: PACKAGE_NAME=$(node -p "require('./package.json').name") CURRENT_VERSION=$(node -p "require('./package.json').version") NPM_VERSION=$(npm view $PACKAGE_NAME version || echo "0.0.0") - if [ "$(printf '%s\n' "$NPM_VERSION" "$CURRENT_VERSION" | sort -V | tail -n1)" != "$CURRENT_VERSION" ] || [ "$NPM_VERSION" == "0.0.0" ]; then - echo "Current version is less than or equal to npm version, or package has not been published to npm yet." - echo "version_changed=false" >> $GITHUB_ENV - else - echo "Current version is greater than npm version." + if [ "$(printf '%s\n' "$NPM_VERSION" "$CURRENT_VERSION" | sort -V | tail -n1)" != "$NPM_VERSION" ] || [ "$NPM_VERSION" == "0.0.0" ]; then + echo "Current version is greater than npm version, or package has not been published to npm yet." echo "version_changed=true" >> $GITHUB_ENV + else + echo "Current version is less than or equal to npm version." + echo "version_changed=false" >> $GITHUB_ENV fi - name: Install dependencies