feat: push the new tag with --push
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
cd179175f5
commit
9faefd2592
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue