diff --git a/pkg/cmd/run/shared/presentation.go b/pkg/cmd/run/shared/presentation.go index 900bd07a1..21ee15c25 100644 --- a/pkg/cmd/run/shared/presentation.go +++ b/pkg/cmd/run/shared/presentation.go @@ -7,14 +7,21 @@ import ( "github.com/cli/cli/v2/pkg/iostreams" ) -func RenderRunHeader(cs *iostreams.ColorScheme, run Run, ago, prNumber string) string { +func RenderRunHeader(cs *iostreams.ColorScheme, run Run, ago, prNumber string, attempt uint64) string { title := fmt.Sprintf("%s %s%s", cs.Bold(run.HeadBranch), run.WorkflowName(), prNumber) symbol, symbolColor := Symbol(cs, run.Status, run.Conclusion) id := cs.Cyanf("%d", run.ID) + var attemptLabel string + if attempt == 0 { + attemptLabel = "Latest Attempt" + } else { + attemptLabel = fmt.Sprintf("Attempt #%d", attempt) + } + header := "" - header += fmt.Sprintf("%s %s · %s\n", symbolColor(symbol), title, id) + header += fmt.Sprintf("%s %s · %s (%s)\n", symbolColor(symbol), title, id, attemptLabel) header += fmt.Sprintf("Triggered via %s %s", run.Event, ago) return header