How is the "commit" deployed URL being put together?

To give full context; I am currently trying to contribute to JakePartusch/wait-for-netlify-action on Github. Due to this issue we are trying to use the “per commit”-deployed URL of Netlify.

Netlify tells use the URL of the commit preview is the following URL:
https://5ee696a8832e3a00089a221a--happy-kilby-80bc73.netlify.app/

Mistakenly, we thought the first 24 characters after the “https://” are the Git commit hash, which does not seem to be the case unfortunately (6c3d413090a8286c00c23429 would be the first 24 characters of the commit SHA).

My question is; is this value randomly generated by Netlify or can we somehow compute this URL just by using Github actions and the capabilities of Git?

Thanks a lot!

Hi, @BrunnerLivio, currently there is no way to know in advance what the deploy id is.

Technically, if you use our API, it returns the deploy id before requesting the files to be uploaded. One might leverage this to get the id and then use it to modify files or during a site build as a variable.

However, outside of creating custom code to interact with the API in this way, there is no other method currently possible.

There is a feature request to be able to choose your own deploy id but I don’t know think this is anywhere on a product roadmap and I wouldn’t expect that feature request to happen soon (if ever). Just being clear as I don’t want to imply it is likely to happen when I know it is not being planned at this time.

If there are other questions, please let us know.