When there is a deployment/code checking/etc, the GitHub API returns an array with the timeline. That means, even if a status has state success now, there is still an object in the array that has the state pending.
This PR adds a filter to the array that removes duplicate statuses, keeping only the last ones (e.g. the ones at the beginning of the array). JSON objects are compared by the target_url property since that's unique and is the only thing that doesn't change between the status update.
When there is a deployment/code checking/etc, the GitHub API returns an array with the timeline. That means, even if a status has state
success
now, there is still an object in the array that has the statepending
.As an example, take a look at this API response from this PR.
This PR adds a filter to the array that removes duplicate statuses, keeping only the last ones (e.g. the ones at the beginning of the array). JSON objects are compared by the
target_url
property since that's unique and is the only thing that doesn't change between the status update.This has been tested in the PR linked above.