Gitinfo .Lastmod uses date of building instead of date of last commit

I have used enableGitInfo = true in config for 1.5 year to lazily set the .Lastmod variable to the date of the last commit. It works when building locally with hugo server.

However, since Hugo 0.123 or so (and with latest 0.128.2), it has stopped working on Github Actions. .Lastmod gets set to the date of building, which is annoying because I hash it for guid in RSS feed, so all pages appear to be new at each rebuild.

What could be the issue ?

Ok, nevermind, Hugo is not at fault here.

I think at some point I changed actions/checkout@v2 to actions/checkout@v3 to fetch the source code from the Action. But v2 probably made a full clone, while v3 does a shallow clone by default. So, anyway I updated to

      - name: Checkout
        uses: actions/checkout@v4
        with:
          submodules: recursive
          fetch-depth: 0

to force full-cloning.

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