forked from toolshed/abra
		
	fix: push tags
This commit is contained in:
		| @ -17,6 +17,7 @@ import ( | ||||
| 	"github.com/AlecAivazis/survey/v2" | ||||
| 	"github.com/docker/distribution/reference" | ||||
| 	"github.com/go-git/go-git/v5" | ||||
| 	configPkg "github.com/go-git/go-git/v5/config" | ||||
| 	"github.com/sirupsen/logrus" | ||||
| 	"github.com/urfave/cli/v2" | ||||
| ) | ||||
| @ -318,7 +319,13 @@ func pushRelease(tagString string, repo *git.Repository) error { | ||||
| 	} | ||||
|  | ||||
| 	if internal.Push { | ||||
| 		if err := repo.Push(&git.PushOptions{}); err != nil { | ||||
| 		tagRef := fmt.Sprintf("+refs/tags/%s:refs/tags/%s", tagString, tagString) | ||||
| 		pushOpts := &git.PushOptions{ | ||||
| 			RefSpecs: []configPkg.RefSpec{ | ||||
| 				configPkg.RefSpec(tagRef), | ||||
| 			}, | ||||
| 		} | ||||
| 		if err := repo.Push(pushOpts); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 		logrus.Info(fmt.Sprintf("pushed tag %s to remote", tagString)) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user