Skip to content

Commit

Permalink
little refactor and skip flag option in case of emergencies
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasSUSE committed Sep 11, 2024
1 parent c5cf11b commit 25becd5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ var (
Version = "v0.0.0-dev"
// GitCommit represents the latest commit when building this script
GitCommit = "HEAD"

// ChartsScriptOptionsFile represents a name of a file that contains options for the charts script to use for this branch
ChartsScriptOptionsFile string
// CurrentPackage represents the specific package to apply the scripts to
Expand Down Expand Up @@ -157,7 +156,6 @@ func main() {
Required: true,
EnvVar: defaultBranchVersionEnvironmentVariable,
}

forkFlag := cli.StringFlag{
Name: "fork",
Usage: `Usage:
Expand Down Expand Up @@ -370,6 +368,10 @@ func main() {
EnvVar: defaultPRNumberEnvironmentVariable,
Destination: &PullRequest,
},
cli.BoolFlag{
Name: "skip",
Usage: "Skip the execution and return success",
},
},
},
}
Expand Down Expand Up @@ -766,6 +768,10 @@ func release(c *cli.Context) {
}

func validateRelease(c *cli.Context) {
if c.Bool("skip") {
fmt.Println("skipping execution...")
return
}
if GithubToken == "" {
fmt.Println("GH_TOKEN environment variable must be set to run validate-release-charts")
os.Exit(1)
Expand Down

0 comments on commit 25becd5

Please sign in to comment.