Shallow clone of git repo

It appears that the deployment pipeline of Cloudflare pages performs a shallow clone of git repositories.
I use Hugo as a static site generator, and there is a module that inspects the git repo to find some details on earlier commits, so that these git commit messages can be rendered in the website. This breaks when Cloudflare’s pipeline performs only a shallow clone.

Ideally, there would be some environment variable that lets us specify something like ‘git clone depth’ that specifies how many commits should be fetched.