MCPcopy Index your code
hub / github.com/cli/cli / RenderRunHeader

Function RenderRunHeader

pkg/cmd/run/shared/presentation.go:10–26  ·  view source on GitHub ↗
(cs *iostreams.ColorScheme, run Run, ago, prNumber string, attempt uint64)

Source from the content-addressed store, hash-verified

8)
9
10func RenderRunHeader(cs *iostreams.ColorScheme, run Run, ago, prNumber string, attempt uint64) string {
11 title := fmt.Sprintf("%s %s%s",
12 cs.Bold(run.HeadBranch), run.WorkflowName(), prNumber)
13 symbol, symbolColor := Symbol(cs, run.Status, run.Conclusion)
14 id := cs.Cyanf("%d", run.ID)
15
16 attemptLabel := ""
17 if attempt > 0 {
18 attemptLabel = fmt.Sprintf(" (Attempt #%d)", attempt)
19 }
20
21 header := ""
22 header += fmt.Sprintf("%s %s · %s%s\n", symbolColor(symbol), title, id, attemptLabel)
23 header += fmt.Sprintf("Triggered via %s %s", run.Event, ago)
24
25 return header
26}
27
28func RenderJobs(cs *iostreams.ColorScheme, jobs []Job, verbose bool) string {
29 lines := []string{}

Callers 2

runViewFunction · 0.92
renderRunFunction · 0.92

Calls 4

SymbolFunction · 0.85
BoldMethod · 0.80
WorkflowNameMethod · 0.80
CyanfMethod · 0.80

Tested by

no test coverage detected