Skip to content

Commit

Permalink
Add conditional when setting current version
Browse files Browse the repository at this point in the history
  • Loading branch information
narin committed Oct 25, 2023
1 parent ebb8f25 commit ea7c0b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit ea7c0b0

Please sign in to comment.