Closed sarah11918 closed 1 month ago
Relying on Git history on CI platforms is a bit problematic. We document this on Starlight's lastUpdated
option since it is affected by it.
I wrote about the specific case of Vercel, but the same applies to GH actions. The actions/checkout
action that does the cloning defaults to a fetch depth of 1.
Maybe something like the Starlight docs would be good here, but I don't think it should have anything specific to any platform. This problem happens to almost all of them, and each has a different way to opt out of that behavior when they even have that option.
When you say "maybe something like", do you mean adding the text about "this may not be accurate?", or do you mean trying to write the recipe "in the way that Starlight does it"?
Adding this or something similar in the recipe:
Reporting the Git time may not be accurate depending on the environment in which the project is being built. Hosting platforms, CIs, and automated testing platforms commonly don't retrieve the full git history required for Git to return the correct values.
Gotcha! Would accept a PR to this recipe that adds this after the introduction, just before the recipe starts, in a note:
:::note[Relying on Git history]
By default, this feature relies on your repositoryβs Git history and may not be accurate on some deployment platforms performing [shallow clones](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt).
:::
π Subject area/topic
recipe -- remark plugin last modified time
π Page(s) affected (or suggested, for new content)
https://docs.astro.build/en/recipes/modified-time/
π Description of content that is out-of-date or incorrect
From Feedback Fish:
The recipe works on my local dev server, but when i deploy it via github action, for some reason i got 'Invalid date' instead. Im not too sure how to troubleshoot this issue, and it would be great if the docs can cover that as an example as well
π₯οΈ Reproduction in StackBlitz (if reporting incorrect content or code samples)
No response