23 lines
357 B
Go
23 lines
357 B
Go
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
|
|
}
|