forked from cli/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactions.go
More file actions
60 lines (47 loc) · 1.7 KB
/
actions.go
File metadata and controls
60 lines (47 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package actions
import (
"fmt"
"github.com/MakeNowJust/heredoc"
"github.com/cli/cli/v2/pkg/cmdutil"
"github.com/cli/cli/v2/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),
Run: func(cmd *cobra.Command, args []string) {
fmt.Fprintln(f.IOStreams.Out, actionsExplainer(cs))
},
Annotations: map[string]string{
"IsActions": "true",
},
}
cmdutil.DisableAuthCheck(cmd)
return cmd
}
func actionsExplainer(cs *iostreams.ColorScheme) string {
header := cs.Bold("Welcome to GitHub Actions on the command line.")
runHeader := cs.Bold("Interacting with workflow runs")
workflowHeader := cs.Bold("Interacting with workflow files")
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>'
`, header, runHeader, workflowHeader)
}