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

22
pkg/git/push.go Normal file
View File

@ -0,0 +1,22 @@
package git
import (
"github.com/go-git/go-git/v5"
"github.com/sirupsen/logrus"
)
// Push pushes the latest changes
func Push(repoPath string) error {
commitRepo, err := git.PlainOpen(repoPath)
if err != nil {
return err
}
if err := commitRepo.Push(&git.PushOptions{}); err != nil {
return err
}
logrus.Info("changes pushed")
return nil
}