You've already forked go-semantic-release
feat(hooks): pass environment variables to hooks
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
changelogCmd.Flags().Bool("checks", false, "Check for missing values and envs")
|
||||
changelogCmd.Flags().StringP("out", "o", "CHANGELOG.md", "Name of the file")
|
||||
rootCmd.AddCommand(changelogCmd)
|
||||
}
|
||||
@@ -35,12 +36,12 @@ var changelogCmd = &cobra.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
ignoreConfigChecks, err := cmd.Flags().GetBool("no-checks")
|
||||
configChecks, err := cmd.Flags().GetBool("checks")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
s, err := semanticrelease.New(readConfig(config), repository, !ignoreConfigChecks)
|
||||
s, err := semanticrelease.New(readConfig(config), repository, configChecks)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
hooksCmd.Flags().Bool("checks", false, "Check for missing values and envs")
|
||||
rootCmd.AddCommand(hooksCmd)
|
||||
}
|
||||
|
||||
@@ -29,14 +30,14 @@ var hooksCmd = &cobra.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
ignoreConfigChecks, err := cmd.Flags().GetBool("no-checks")
|
||||
configChecks, err := cmd.Flags().GetBool("checks")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
releaseConfig := readConfig(config)
|
||||
|
||||
s, err := semanticrelease.New(releaseConfig, repository, !ignoreConfigChecks)
|
||||
s, err := semanticrelease.New(releaseConfig, repository, configChecks)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
lastCmd.Flags().Bool("checks", false, "Check for missing values and envs")
|
||||
rootCmd.AddCommand(lastCmd)
|
||||
}
|
||||
|
||||
@@ -30,12 +31,12 @@ var lastCmd = &cobra.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
ignoreConfigChecks, err := cmd.Flags().GetBool("no-checks")
|
||||
configChecks, err := cmd.Flags().GetBool("checks")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
s, err := semanticrelease.New(readConfig(config), repository, !ignoreConfigChecks)
|
||||
s, err := semanticrelease.New(readConfig(config), repository, configChecks)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
nextCmd.Flags().Bool("checks", false, "Check for missing values and envs")
|
||||
rootCmd.AddCommand(nextCmd)
|
||||
}
|
||||
|
||||
@@ -30,12 +31,12 @@ var nextCmd = &cobra.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
ignoreConfigChecks, err := cmd.Flags().GetBool("no-checks")
|
||||
configChecks, err := cmd.Flags().GetBool("checks")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
s, err := semanticrelease.New(readConfig(config), repository, !ignoreConfigChecks)
|
||||
s, err := semanticrelease.New(readConfig(config), repository, configChecks)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
releaseCmd.Flags().Bool("no-checks", false, "Ignore missing values and envs")
|
||||
rootCmd.AddCommand(releaseCmd)
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ func init() {
|
||||
rootCmd.PersistentFlags().StringP("loglevel", "l", "error", "Set loglevel")
|
||||
rootCmd.PersistentFlags().StringP("config", "c", ".release.yml", "Path to config file")
|
||||
rootCmd.PersistentFlags().Bool("no-cache", false, "Ignore cache, don't use in ci build")
|
||||
rootCmd.PersistentFlags().Bool("no-checks", false, "Ignore missing values and envs")
|
||||
}
|
||||
|
||||
func readConfig(file string) *config.ReleaseConfig {
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
setCmd.Flags().Bool("checks", false, "Check for missing values and envs")
|
||||
rootCmd.AddCommand(setCmd)
|
||||
}
|
||||
|
||||
@@ -26,12 +27,12 @@ var setCmd = &cobra.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
ignoreConfigChecks, err := cmd.Flags().GetBool("no-checks")
|
||||
configChecks, err := cmd.Flags().GetBool("checks")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
s, err := semanticrelease.New(readConfig(config), repository, !ignoreConfigChecks)
|
||||
s, err := semanticrelease.New(readConfig(config), repository, configChecks)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
zipCmd.Flags().Bool("checks", false, "Check for missing values and envs")
|
||||
zipCmd.Flags().StringP("algorithm", "a", "sha256", "Algorithm for checksum (crc32,md5,sha1,sha224,sha384,sha256,sha512)")
|
||||
rootCmd.AddCommand(zipCmd)
|
||||
}
|
||||
@@ -24,12 +25,12 @@ var zipCmd = &cobra.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
ignoreConfigChecks, err := cmd.Flags().GetBool("no-checks")
|
||||
configChecks, err := cmd.Flags().GetBool("checks")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
s, err := semanticrelease.New(readConfig(config), repository, !ignoreConfigChecks)
|
||||
s, err := semanticrelease.New(readConfig(config), repository, configChecks)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user