diff --git a/pkg/cmd/actions/actions.go b/pkg/cmd/actions/actions.go index f0e3509a4..5be2df305 100644 --- a/pkg/cmd/actions/actions.go +++ b/pkg/cmd/actions/actions.go @@ -21,7 +21,7 @@ func NewCmdActions(f *cmdutil.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "actions", Short: "Learn about working with GitHub actions", - Args: cobra.ExactArgs(0), + Long: actionsExplainer(nil), Hidden: true, Run: func(cmd *cobra.Command, args []string) { actionsRun(opts) @@ -34,28 +34,45 @@ func NewCmdActions(f *cmdutil.Factory) *cobra.Command { return cmd } +func actionsExplainer(cs *iostreams.ColorScheme) string { + header := "Welcome to GitHub Actions on the command line." + runHeader := "Interacting with workflow runs" + workflowHeader := "Interacting with workflow files" + if cs != nil { + header = cs.Bold(header) + runHeader = cs.Bold(runHeader) + workflowHeader = cs.Bold(workflowHeader) + } + + return heredoc.Docf(` + %s + + gh integrates with Actions to help you manage runs and workflows. + + %s + gh run list: List recent workflow runs + gh run view: View details for a workflow run or one of its jobs + gh run watch: Watch a workflow run while it executes + gh run rerun: Rerun a failed workflow run + gh run download: Download artifacts generated by runs + + To see more help, run 'gh help run ' + + %s + gh workflow list: List all the workflow files in your repository + gh workflow view: View details for a workflow file + gh workflow enable: Enable a workflow file + gh workflow disable: Disable a workflow file + gh workflow run: Trigger a workflow_dispatch run for a workflow file + + To see more help, run 'gh help workflow ' + + For more in depth help including examples, see online documentation at: + https://docs.github.com/en/actions/guides/managing-github-actions-with-github-cli + `, header, runHeader, workflowHeader) +} + func actionsRun(opts ActionsOptions) { cs := opts.IO.ColorScheme() - fmt.Fprint(opts.IO.Out, heredoc.Docf(` - Welcome to GitHub Actions on the command line. - - This part of gh is in beta and subject to change! - - To follow along while we get to GA, please see this - tracking issue: https://github.com/cli/cli/issues/2889 - - %s - gh run list: List recent workflow runs - gh run view: View details for a workflow run or one of its jobs - gh run watch: Watch a workflow run while it executes - gh run rerun: Rerun a failed workflow run - - %s - gh workflow list: List all the workflow files in your repository - gh workflow enable: Enable a workflow file - gh workflow disable: Disable a workflow file - gh workflow run: Trigger a workflow_dispatch run for a workflow file - `, - cs.Bold("Interacting with workflow runs"), - cs.Bold("Interacting with workflow files"))) + fmt.Fprintln(opts.IO.Out, actionsExplainer(cs)) }