refactor: don't show latest attempt

This commit is contained in:
Wing-Kam Wong 2023-03-26 16:20:57 +08:00
parent 3796b6d6e8
commit 897a2aa53f

View file

@ -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