Netlify API: Not every build returns its SHA

Hi,
We are building a pipeline where I need to tie the build with its commit, but some builds return a null SHA when calling the ListSiteBuilds API:

The endpoint returning more details for a specific build doesn’t even has a SHA on it.

It looks like the commits from HEAD don’t have the SHA:

image

Any idea why? Could we get the SHA from every build, please?

Thanks.

Sorry to hear it’s causing problems, but that is intended. We only record the SHA for commits triggered directly by a notification from your git provider; the builds @HEAD are triggered by build hooks or by someone hitting ‘trigger build’ in our UI.

I’ve sent this perfectly reasonable feature request through to our product team, but I recommend that you run something like git status to capture the current ref during all builds so you can at least correlate from the logs for the time being, since we won’t build that in the next couple of weeks at least (and we may never build it; our Product Management team chooses what’s on the roadmap, and they’ve now heard your request :))

1 Like