fix: ensure tags & commits are pushed

This commit is contained in:
2021-12-23 02:24:43 +01:00
parent a7894cbda9
commit 014d32112e
4 changed files with 39 additions and 14 deletions

View File

@ -8,7 +8,7 @@ import (
)
// Commit runs a git commit
func Commit(repoPath, glob, commitMessage string, dryRun, push bool) error {
func Commit(repoPath, glob, commitMessage string, dryRun bool) error {
if commitMessage == "" {
return fmt.Errorf("no commit message specified?")
}
@ -52,14 +52,5 @@ func Commit(repoPath, glob, commitMessage string, dryRun, push bool) error {
logrus.Info("dry run: no changes commited")
}
if !dryRun && push {
if err := commitRepo.Push(&git.PushOptions{}); err != nil {
return err
}
logrus.Info("changes pushed")
} else {
logrus.Info("dry run: no changes pushed")
}
return nil
}