From 897a2aa53f3d65fd15974c7f652a02f656240693 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Sun, 26 Mar 2023 16:20:57 +0800 Subject: [PATCH] refactor: don't show latest attempt --- pkg/cmd/run/shared/presentation.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/cmd/run/shared/presentation.go b/pkg/cmd/run/shared/presentation.go index 21ee15c25..2ec149729 100644 --- a/pkg/cmd/run/shared/presentation.go +++ b/pkg/cmd/run/shared/presentation.go @@ -13,15 +13,13 @@ func RenderRunHeader(cs *iostreams.ColorScheme, run Run, ago, prNumber string, a 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) + attemptLabel := "" + if attempt > 0 { + attemptLabel = fmt.Sprintf(" (Attempt #%d)", attempt) } header := "" - header += fmt.Sprintf("%s %s · %s (%s)\n", symbolColor(symbol), title, id, attemptLabel) + 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