Skip to content

Commit f4da5d5

Browse files
committed
Make release version bump idempotent in deploy workflow
1 parent b5df103 commit f4da5d5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ jobs:
3737
run: |
3838
VERSION="${{ github.ref_name }}"
3939
VERSION="${VERSION#v}" # Strip 'v' prefix if present
40+
CURRENT="$(node -p "require('./package.json').version")"
41+
# Idempotent: skip when the version was already bumped before the
42+
# release was cut (npm version errors on an unchanged version).
43+
if [[ "$CURRENT" == "$VERSION" ]]; then
44+
echo "package.json already at $VERSION, skipping bump"
45+
exit 0
46+
fi
4047
echo "Updating package.json version to $VERSION"
4148
npm version $VERSION --no-git-tag-version
4249
git config user.name "github-actions[bot]"

0 commit comments

Comments
 (0)