Builds: CACHED_COMMIT_REF environment variable now available

The environment variable CACHED_COMMIT_REF is now available to your builds. It contains the reference ID (also known as ‘SHA’ or ‘hash’) of the last commit that Netlify built before the current build.

See the Netlify docs about environment variables for more information on this and other environment variables you can use to customize your builds.

1 Like

The variable has the wrong value. It shows the current hash, not the last one built by netlify. At least when used in the custom ignore command.

Hi, @LukasGentele. It definitely doesn’t show the wrong value when I test and no one else is reporting any issues so I suspect there is some valid reason for this happening.

We can research this to find out what is the root cause of that. Would you please tell us the deploy id for the deploy where that happened? The deploy id is the string at the end of the URL for the deploy details. For example, with the deploy details URL below:

https://app.netlify.com/sites/mu-gatsby-starter-foundation/deploys/61af30108d9081a1cd55d126

The deploy id is 61af30108d9081a1cd55d126. With that information, we can find out what occurred.

You can post that information publicly or you can private message (PM) that to one of our support staff. I’ve confirmed that PMs are enabled for your forum login. Please keep in mind that only one person can see the PM and this will likely mean a slower reply than posting the information publicly. Please feel free to reply to however you prefer though.