diff --git a/go.mod b/go.mod index 4485261..9060335 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module github.com/Cardinal-Cryptography/github-actions-validator go 1.19 require ( - github.com/nicholasgasior/go-broccli v2.0.0+incompatible + github.com/mikolajgs/broccli v2.0.0+incompatible gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index 625d20d..237765b 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/nicholasgasior/go-broccli v2.0.0+incompatible h1:5tyBPdc9C4QGpZP2U7rNj3ZVdUCKkjJ8Qw9PsLNgQ8I= -github.com/nicholasgasior/go-broccli v2.0.0+incompatible/go.mod h1:HXVuYqjA19/qowITJDKRqz7+JPDwt2CExGBwHYF/zLA= +github.com/mikolajgs/broccli v2.0.0+incompatible h1:zpLdjMIA9QrUtcXQqjFi3WCY3P8n+/45VHRAc2bfZ4c= +github.com/mikolajgs/broccli v2.0.0+incompatible/go.mod h1:IOqvFr2wSjX/7otXFff5+jOdyWVXi5OsKEJ5viXk/vg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= diff --git a/main.go b/main.go index d7c41bf..89b24e0 100644 --- a/main.go +++ b/main.go @@ -2,18 +2,18 @@ package main import ( "fmt" - gocli "github.com/nicholasgasior/go-broccli" + "github.com/mikolajgs/broccli" "os" "github.com/Cardinal-Cryptography/github-actions-validator/pkg/dotgithub" ) func main() { - cli := gocli.NewCLI("github-actions-validator", "Validates GitHub Actions' .github directory", "devops@cc") + cli := broccli.NewCLI("github-actions-validator", "Validates GitHub Actions' .github directory", "infra-team@cardinals") cmdValidate := cli.AddCmd("validate", "Runs the validation on files from a specified directory", validateHandler) - cmdValidate.AddFlag("path", "p", "", "Path to .github directory", gocli.TypePathFile, gocli.IsDirectory|gocli.IsExistent|gocli.IsRequired) - cmdValidate.AddFlag("vars-file", "z", "", "Check if variable names exist in this file (one per line)", gocli.TypePathFile, gocli.IsExistent) - cmdValidate.AddFlag("secrets-file", "s", "", "Check if secret names exist in this file (one per line)", gocli.TypePathFile, gocli.IsExistent) + cmdValidate.AddFlag("path", "p", "", "Path to .github directory", broccli.TypePathFile, broccli.IsDirectory|broccli.IsExistent|broccli.IsRequired) + cmdValidate.AddFlag("vars-file", "z", "", "Check if variable names exist in this file (one per line)", broccli.TypePathFile, broccli.IsExistent) + cmdValidate.AddFlag("secrets-file", "s", "", "Check if secret names exist in this file (one per line)", broccli.TypePathFile, broccli.IsExistent) _ = cli.AddCmd("version", "Prints version", versionHandler) if len(os.Args) == 2 && (os.Args[1] == "-v" || os.Args[1] == "--version") { os.Args = []string{"App", "version"} @@ -21,12 +21,12 @@ func main() { os.Exit(cli.Run()) } -func versionHandler(c *gocli.CLI) int { +func versionHandler(c *broccli.CLI) int { fmt.Fprintf(os.Stdout, VERSION+"\n") return 0 } -func validateHandler(c *gocli.CLI) int { +func validateHandler(c *broccli.CLI) int { dotGithub := dotgithub.DotGithub{ Path: c.Flag("path"), VarsFile: c.Flag("vars-file"), diff --git a/version.go b/version.go index 01904ef..405e86d 100644 --- a/version.go +++ b/version.go @@ -1,3 +1,3 @@ package main -const VERSION = "0.5.1" +const VERSION = "0.5.2"