From 2e4ffc0e79ee59377dbed1f7c9f950e7031e13af Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 6 Sep 2025 05:11:11 -0400 Subject: [PATCH] Add force push for updated tags --- build_and_push.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/build_and_push.sh b/build_and_push.sh index 79f4be3..2c28bd4 100755 --- a/build_and_push.sh +++ b/build_and_push.sh @@ -240,8 +240,13 @@ git_commit_and_push() { if git push origin "$NEW_VERSION" > /dev/null 2>&1; then print_success "Pushed tag: $NEW_VERSION" else - print_error "Failed to push tag: $NEW_VERSION" - exit 1 + print_warning "Tag push failed, trying force push..." + if git push --force origin "$NEW_VERSION" > /dev/null 2>&1; then + print_success "Force-pushed updated tag: $NEW_VERSION" + else + print_error "Failed to push tag: $NEW_VERSION" + exit 1 + fi fi } @@ -283,8 +288,13 @@ git_commit_and_push_no_tag() { if git push origin "$NEW_VERSION" > /dev/null 2>&1; then print_success "Pushed tag: $NEW_VERSION" else - print_error "Failed to push tag: $NEW_VERSION" - exit 1 + print_warning "Tag push failed, trying force push..." + if git push --force origin "$NEW_VERSION" > /dev/null 2>&1; then + print_success "Force-pushed updated tag: $NEW_VERSION" + else + print_error "Failed to push tag: $NEW_VERSION" + exit 1 + fi fi }