As part of our deployment flow, before creating a new deployment I’d like to show the user a compare link and summary commit log between the current active deployment and the SHA that’s now ready to deploy.
However, it looks like this is actually a bit tricky to figure out through the API?
I don’t see an option to filter the list deployments API call (e.g. to only show successful ones) and the response to that call doesn’t itself include any info about the current status of that deployment.
It looks like the only way to get this info would be to call “List deployments” then iterate over the result and call “list deployment statuses” for each deployment in turn until I find one that’s successful? That doesn’t seem very efficient (though hopefully usually I’d not have to go too far back in history to find it).
Is there a better way to do this? I note that both the most recent successful and the status of each deployment are shown on the deployments page within github so I’m wondering if that data is actually available somewhere and I’m just not seeing it.