diff --git a/pkg/cmd/actions/actions.go b/pkg/cmd/actions/actions.go index 0bcd5118d..fedd38af4 100644 --- a/pkg/cmd/actions/actions.go +++ b/pkg/cmd/actions/actions.go @@ -26,6 +26,9 @@ func NewCmdActions(f *cmdutil.Factory) *cobra.Command { Run: func(cmd *cobra.Command, args []string) { actionsRun(opts) }, + Annotations: map[string]string{ + "IsActions": "true", + }, } return cmd diff --git a/pkg/cmd/root/help.go b/pkg/cmd/root/help.go index 80b61341e..552c2a451 100644 --- a/pkg/cmd/root/help.go +++ b/pkg/cmd/root/help.go @@ -88,6 +88,7 @@ func rootHelpFunc(cs *iostreams.ColorScheme, command *cobra.Command, args []stri } coreCommands := []string{} + actionsCommands := []string{} additionalCommands := []string{} for _, c := range command.Commands() { if c.Short == "" { @@ -100,6 +101,8 @@ func rootHelpFunc(cs *iostreams.ColorScheme, command *cobra.Command, args []stri s := rpad(c.Name()+":", c.NamePadding()) + c.Short if _, ok := c.Annotations["IsCore"]; ok { coreCommands = append(coreCommands, s) + } else if _, ok := c.Annotations["IsActions"]; ok { + actionsCommands = append(actionsCommands, s) } else { additionalCommands = append(additionalCommands, s) } @@ -126,6 +129,9 @@ func rootHelpFunc(cs *iostreams.ColorScheme, command *cobra.Command, args []stri if len(coreCommands) > 0 { helpEntries = append(helpEntries, helpEntry{"CORE COMMANDS", strings.Join(coreCommands, "\n")}) } + if len(actionsCommands) > 0 { + helpEntries = append(helpEntries, helpEntry{"ACTIONS COMMANDS", strings.Join(actionsCommands, "\n")}) + } if len(additionalCommands) > 0 { helpEntries = append(helpEntries, helpEntry{"ADDITIONAL COMMANDS", strings.Join(additionalCommands, "\n")}) } diff --git a/pkg/cmd/run/run.go b/pkg/cmd/run/run.go index a1620e3b4..a3aacdcdc 100644 --- a/pkg/cmd/run/run.go +++ b/pkg/cmd/run/run.go @@ -11,10 +11,11 @@ func NewCmdRun(f *cmdutil.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "run ", Short: "View details about workflow runs", - Hidden: true, Long: "List, view, and watch recent workflow runs from GitHub Actions.", - // TODO i'd like to have all the actions commands sorted into their own zone which i think will - // require a new annotation + Hidden: true, + Annotations: map[string]string{ + "IsActions": "true", + }, } cmdutil.EnableRepoOverride(cmd, f) diff --git a/pkg/cmd/workflow/workflow.go b/pkg/cmd/workflow/workflow.go index b3632ce17..a61e28ca4 100644 --- a/pkg/cmd/workflow/workflow.go +++ b/pkg/cmd/workflow/workflow.go @@ -12,10 +12,11 @@ func NewCmdWorkflow(f *cmdutil.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "workflow ", Short: "View details about GitHub Actions workflows", - Hidden: true, Long: "List, view, and run workflows in GitHub Actions.", - // TODO i'd like to have all the actions commands sorted into their own zone which i think will - // require a new annotation + Hidden: true, + Annotations: map[string]string{ + "IsActions": "true", + }, } cmdutil.EnableRepoOverride(cmd, f)