feat: push the new tag with --push
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
knoflook 2021-09-23 18:52:21 +02:00
parent cd179175f5
commit 9faefd2592
Signed by: knoflook
GPG Key ID: D6A1D0E8FC4FEF1C
1 changed files with 20 additions and 0 deletions

View File

@ -17,6 +17,13 @@ import (
"github.com/urfave/cli/v2"
)
var Push bool
var PushFlag = &cli.BoolFlag{
Name: "push",
Value: false,
Destination: &Push,
}
var Dry bool
var DryFlag = &cli.BoolFlag{
Name: "dry-run",
@ -59,6 +66,7 @@ var recipeReleaseCommand = &cli.Command{
PatchFlag,
MinorFlag,
MajorFlag,
PushFlag,
},
Action: func(c *cli.Context) error {
recipe := internal.ValidateRecipe(c)
@ -85,6 +93,12 @@ var recipeReleaseCommand = &cli.Command{
Message: tag,
})*/
logrus.Info(fmt.Sprintf("Created tag %s at %s.", tagstring, head.Hash()))
if Push {
if err := repo.Push(&git.PushOptions{}); err != nil {
logrus.Fatal(err)
}
logrus.Info(fmt.Sprintf("Pushed tag %s to remote.", tagstring))
}
return nil
}
@ -164,6 +178,12 @@ var recipeReleaseCommand = &cli.Command{
Message: tag,
})*/
logrus.Info(fmt.Sprintf("Created tag %s at %s.", newTagString, head.Hash()))
if Push {
if err := repo.Push(&git.PushOptions{}); err != nil {
logrus.Fatal(err)
}
logrus.Info(fmt.Sprintf("Pushed tag %s to remote.", newTagString))
}
return nil