cli/pkg/cmd/actions/actions.go
Mislav Marohnić 052d6588ea Revert "Whitespace"
Trailing whitespace is significant in Markdown.

This reverts commit 682c15d52c.
2021-06-18 15:16:48 +02:00

61 lines
1.8 KiB
Go

package actions
import (
"github.com/MakeNowJust/heredoc"
"github.com/cli/cli/pkg/cmdutil"
"github.com/cli/cli/pkg/iostreams"
"github.com/spf13/cobra"
)
func NewCmdActions(f *cmdutil.Factory) *cobra.Command {
cs := f.IOStreams.ColorScheme()
cmd := &cobra.Command{
Use: "actions",
Short: "Learn about working with GitHub actions",
Long: actionsExplainer(cs),
Annotations: map[string]string{
"IsActions": "true",
},
}
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
GitHub CLI 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 <subcommand>'
%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 <subcommand>'
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)
}