Home
Support Forums

Dynamically displaying build ID or commit hash

Hello,

General question:

This is a status badge for my site displaying the latest build status :
(https://api.netlify.com/api/v1/badges/eb893292-e753-441b-bfb2-ca354ffaf503/deploy-status)

I would like to show the Github commit hash or the build number instead on my website. Something like a status badge but then displaying commit hash or a version of the build.

Is this possible? How can I achieve this?

Thanks,

Marc

Hi @Marc,

This doesn’t seem readily possible on Netlify. You might have to use something like: GitHub - heipei/github-commit-badge: This is a banner which can display the latest commit of a Github-repo on your website..

He @Marc

There is several Git metadata environment variables available including COMMIT_REF. The method to use them in your build will depend on your build. This Support Guide may help though.