Skip to content

Commit c5f6bef

Browse files
fix: skip version commit when already at target version
1 parent 4b1bc23 commit c5f6bef

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

scripts/release-safe.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,15 @@ create_release() {
222222
exit 1
223223
fi
224224

225-
# Commit version changes
226-
print_step "Committing version changes..."
225+
# Commit version changes (skip if already at target version)
227226
git add package.json deno.json
228-
git commit -m "chore: bump version to $version"
229-
print_success "Version bump committed"
227+
if git diff --cached --quiet; then
228+
print_warning "Version already at $version, skipping commit"
229+
else
230+
print_step "Committing version changes..."
231+
git commit -m "chore: bump version to $version"
232+
print_success "Version bump committed"
233+
fi
230234

231235
# Create tag
232236
print_step "Creating tag $tag_name..."

0 commit comments

Comments
 (0)