github.com/andrewhsu/cli/v2@v2.0.1-0.20210910131313-d4b4061f5b89/pkg/cmd/secret/secret.go (about)

     1  package secret
     2  
     3  import (
     4  	"github.com/MakeNowJust/heredoc"
     5  	cmdList "github.com/andrewhsu/cli/v2/pkg/cmd/secret/list"
     6  	cmdRemove "github.com/andrewhsu/cli/v2/pkg/cmd/secret/remove"
     7  	cmdSet "github.com/andrewhsu/cli/v2/pkg/cmd/secret/set"
     8  	"github.com/andrewhsu/cli/v2/pkg/cmdutil"
     9  	"github.com/spf13/cobra"
    10  )
    11  
    12  func NewCmdSecret(f *cmdutil.Factory) *cobra.Command {
    13  	cmd := &cobra.Command{
    14  		Use:   "secret <command>",
    15  		Short: "Manage GitHub secrets",
    16  		Long: heredoc.Doc(`
    17  			Secrets can be set at the repository, environment, or organization level for use in
    18  			GitHub Actions. Run "gh help secret set" to learn how to get started.
    19  `),
    20  	}
    21  
    22  	cmdutil.EnableRepoOverride(cmd, f)
    23  
    24  	cmd.AddCommand(cmdList.NewCmdList(f, nil))
    25  	cmd.AddCommand(cmdSet.NewCmdSet(f, nil))
    26  	cmd.AddCommand(cmdRemove.NewCmdRemove(f, nil))
    27  
    28  	return cmd
    29  }