Skip to content

Commit f9c6952

Browse files
committed
Fix release.yml to update version in package.json only ifnecessary
1 parent 8b1f97e commit f9c6952

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,15 @@ jobs:
122122

123123
- name: 🔢 Update version in package.json
124124
run: |
125-
npm version ${{ needs.determine-release.outputs.version }} --no-git-tag-version
126-
echo "Updated version to: $(node -p "require('./package.json').version")"
125+
CURRENT_VERSION=$(node -p "require('./package.json').version")
126+
DESIRED_VERSION="${{ needs.determine-release.outputs.version }}"
127+
if [ "$CURRENT_VERSION" != "$DESIRED_VERSION" ]; then
128+
echo "Updating version from $CURRENT_VERSION to $DESIRED_VERSION"
129+
npm version "$DESIRED_VERSION" --no-git-tag-version
130+
echo "Updated version to: $(node -p \"require('./package.json').version\")"
131+
else
132+
echo "Version already set to $DESIRED_VERSION, skipping update."
133+
fi
127134
128135
- name: 🧪 Run tests (fast check)
129136
run: |

0 commit comments

Comments
 (0)