Pipetrics

GitHub Actions Negative Durations After Reruns

GitHub Actions negative durations can appear when rerun jobs contain reversed timestamps. Learn why they happen and how Pipetrics keeps CI metrics accurate.

GitHub Actions negative durations should be impossible. Still, we found them in a Pipetrics repository summary after a workflow rerun.

The problem came from timestamps sent by GitHub for skipped jobs. The example values differ from production data, but they preserve the behavior we observed.

GitHub reruns can return stale completion timestamps

When GitHub reran a workflow, it recreated skipped jobs with new created_at and started_at values. Their completed_at value, however, still referred to the earlier attempt.

A simplified example looks like this:

created_at:   2026-07-24T09:14:00Z
started_at:   2026-07-24T09:14:00Z
completed_at: 2026-07-23T21:09:00Z

In this example, the job appears to finish 12 hours and 5 minutes before it starts.

We confirmed the reversed timestamps in the original event payload. Our webhook processing, storage, and date parsing preserved the values correctly. The data received from GitHub already contained the inconsistency.

GitHub documents how users can rerun workflows and jobs, but an analytics system should not assume that every timestamp combination returned for a recreated skipped job is valid.

Why Pipetrics displayed a negative runtime

Pipetrics calculated job duration by subtracting started_at from completed_at. That works for normal jobs, but a stale completion timestamp produces a negative result.

Our monthly total then included several affected skipped jobs. Their negative durations offset valid workflow runtime, which caused the impossible number shown in the repository overview.

How we fixed GitHub Actions negative durations

Pipetrics now excludes skipped jobs and rejects any job whose completion time is earlier than its start time. We still include valid jobs from every rerun attempt in runtime and cost calculations.

We shipped the fix in August 2026. Repository summaries now reflect valid GitHub Actions runtime without allowing reversed timestamps to distort the result.

See the Pipetrics August 2026 product update for the other improvements released alongside this fix.

On this page