How does Cloudflare Pages fetch from GitHub

(Note: Edited the post as the template didn’t allow any non-issue-like posts here. If you can, consider removing this template or make it less restrictive. Thank you)

For Workes & Pages, what is the name of the domain?

https://documentation-cvg.pages.dev/

The question

I would like to know, how Cloudflare Pages fetches git information from GitHub, specifically the fetch-depth

Details

I would like to know what git settings Cloudflare Pages is using when fetching data from GitHub. The site that is being deployed is utilizing the git dates for creation and last edit to display a page’s creation and last edit respectively. The main issue with that would be, that if a shallow fetch was made, that the dates displayed would be incorrect. So I hope Cloudflare Pages uses a normal fetch or otherwise allows to modify the default fetch-depth.

It does a shallow fetch.

You can add git fetch --unshallow to your build command in your project. So if your build command is npm run build you could for example change that to git fetch --unshallow && npm run build. This will allow you to use git dates.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.