diff --git a/main.go b/main.go index 5c8702f..e3542b5 100644 --- a/main.go +++ b/main.go @@ -181,10 +181,14 @@ func main() { log.Printf("%d jobs for workflow run: %d", len(workflowJobs), run.GetID()) for _, job := range workflowJobs { - dur := job.GetCompletedAt().Time.Sub(job.GetStartedAt().Time) - allUsage += dur - log.Printf("Job: %d [%s - %s] (%s): %s", - job.GetID(), job.GetStartedAt().Format("2006-01-02 15:04:05"), job.GetCompletedAt().Format("2006-01-02 15:04:05"), humanDuration(dur), job.GetConclusion()) + if !job.GetCompletedAt().IsZero() { + dur := job.GetCompletedAt().Time.Sub(job.GetStartedAt().Time) + allUsage += dur + log.Printf("Job: %d [%s - %s] (%s): %s", + job.GetID(), job.GetStartedAt().Format("2006-01-02 15:04:05"), + job.GetCompletedAt().Format("2006-01-02 15:04:05"), + humanDuration(dur), job.GetConclusion()) + } } } }