Dynamically displaying build ID or commit hash


General question:

This is a status badge for my site displaying the latest build 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?



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.