diff --git a/cli/recipe/release.go b/cli/recipe/release.go index ff8ed1b8..55c29567 100644 --- a/cli/recipe/release.go +++ b/cli/recipe/release.go @@ -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))