diff --git a/main.go b/main.go index 6a145b8..c19691e 100644 --- a/main.go +++ b/main.go @@ -231,16 +231,18 @@ func main() { summary := repoSummary[owner+"/"+repo.GetName()] for _, job := range jobs.Jobs { - dur := job.GetCompletedAt().Time.Sub(job.GetStartedAt().Time) - if dur > longestBuild { - longestBuild = dur - } - if dur > summary.LongestBuild { - summary.LongestBuild = dur + if !job.GetCompletedAt().IsZero() { + dur := job.GetCompletedAt().Time.Sub(job.GetStartedAt().Time) + if dur > longestBuild { + longestBuild = dur + } + if dur > summary.LongestBuild { + summary.LongestBuild = dur + } + + summary.TotalTime += dur } - summary.TotalTime += dur - if _, ok := conclusion[job.GetConclusion()]; !ok { conclusion[job.GetConclusion()] = 0 }