From ea7c0b0bbaede4b3aa91e8a7cb190fddcda2c69d Mon Sep 17 00:00:00 2001 From: Narin Ratana Date: Wed, 25 Oct 2023 12:33:16 -0700 Subject: [PATCH] Add conditional when setting current version --- .github/workflows/publish-package.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 305de998..7d6bbd4f 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -45,12 +45,15 @@ jobs: run: | NPM_PACKAGE=$(jq -r .name package.json) echo "NPM Package name: $NPM_PACKAGE" + CURRENT_VERSION=$(jq -r .version package.json) LATEST_VERSION=$(npm view $NPM_PACKAGE version) echo "Latest NPM version: $LATEST_VERSION" echo "Setting package.json version to $LATEST_VERSION" - npm version $LATEST_VERSION + if [[ "$CURRENT_VERSION" != "$LATEST_VERSION" ]]; then + npm version $LATEST_VERSION + fi echo "Bumping version: ${{ inputs.version_bump }}" npm version ${{ inputs.version_bump }}