add tag check to doRelease()

This commit is contained in:
Jeff Carr 2025-09-12 14:52:13 -05:00
parent fd2254cd72
commit 63dc802ded
3 changed files with 14 additions and 3 deletions

View File

@ -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.")

View File

@ -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
}

View File

@ -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)
}
}
}
}