From 63dc802ded383a6681ad08562ca1eeccfdebfa38 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 12 Sep 2025 14:52:13 -0500 Subject: [PATCH] add tag check to doRelease() --- doRelease.go | 10 ++++++++++ findNext.go | 3 +-- prepareRelease.go | 4 +++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/doRelease.go b/doRelease.go index 047ac8e..7ce89ec 100644 --- a/doRelease.go +++ b/doRelease.go @@ -57,6 +57,16 @@ func doRelease() error { check.Reload() return fmt.Errorf("already released %s", check.GetGoPath()) } + + // check if the git tag already exists somehow + testtag := me.release.version.String() + if check.LocalTagExists(testtag) { + log.Info("TAG ALREADY EXISTS", testtag) + return log.Errorf("%s TAG ALREADY EXISTS %s", check.FullPath, testtag) + } else { + log.Info("TAG IS NEW", testtag) + } + if me.forge.Config.IsPrivate(me.current.GetGoPath()) { // do not self update private repos log.Info("This is a private repo.") diff --git a/findNext.go b/findNext.go index 1389168..6c6b6b8 100644 --- a/findNext.go +++ b/findNext.go @@ -1,4 +1,3 @@ -// This is a simple example package main import ( @@ -116,6 +115,7 @@ func findNext() bool { setCurrentRepo(check, "should be good to release", "pretty sure") return true } + if findCounter == 0 { log.Info("NOTHING TO UPDATE. findCounter =", findCounter, "found len =", me.found.Len()) if me.found.Len() == 0 { @@ -159,7 +159,6 @@ func setCurrentRepo(check *gitpb.Repo, s string, note string) bool { me.release.status.SetText(s) me.release.notes.SetText(note) // me.release.openrepo.Enable() - return true } diff --git a/prepareRelease.go b/prepareRelease.go index 3055c88..c447ff9 100644 --- a/prepareRelease.go +++ b/prepareRelease.go @@ -227,7 +227,9 @@ func rePrepareRelease() { for repo := range me.found.IterAll() { if repo.CurrentBranchName != repo.MasterBranchName { log.Info("repo not on master branch", repo.FullPath) - os.Exit(-1) + if !argv.Force { + os.Exit(-1) + } } } }