Closed ZtfCoder closed 2 months ago
https://github.com/ZtfCoder/blog ---use store https://github.com/ZtfCoder/ZtfCoder.github.io ---use view
Same problem, I suspect it's caused by the behavior of some plugins/dependencies.
vitepress uses git timestamp for lastUpdated. If you're just copying and committing things from one repo to another, the last commit time of all the files will change.
How should I operate correctly
Ah, I just re-read your question. You just need to add fetch-depth: 0
to actions/checkout:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
https://github.com/ZtfCoder/blog/blob/master/.github/workflows/main.yml#L16
啊,我刚刚重新阅读了你的问题。您只需要添加到操作/结帐:
fetch-depth: 0
- name: Checkout uses: actions/checkout@v4 with: persist-credentials: false fetch-depth: 0
https://github.com/ZtfCoder/blog/blob/master/.github/workflows/main.yml#L16
Thank you, the last update time is now displayed correctly. Thank you very much!
Describe the bug
I compiled the product and pushed it to another repository through GitHub workflow. How can I make lastUpdating Time work correctly? Now, lastUpdating Time is always the latest time from another repository
Reproduction
no
Expected behavior
Correctly display lastUpdating Time
System Info
Additional context
No response
Validations