Non-ascii filename breaks lastmod
lingsamuel opened this issue · 4 comments
lingsamuel commented
Describe the bug
I enabled GitInfo and set fetch-depth: 0
in github actions.
Files with ascii filename works well. But files with Chinese (or non-ascii? not sure) always generate "now" as lastmod (just like GitInfo disabled).
I am not sure if it's a actions-hugo bug or hugo bug. But the lastmod works pretty well locally, so I guess it's the actions probelm?
To Reproduce
Steps to reproduce the behavior:
- Create post with Chinese filename, such as
中文文件名.md
- Push to the remote repo, the actions run and deploy
- Trigger the action without modifying the file above
- See the lastmod changes (in sitemap.xml or else)
Expected behavior
The lastmod should be stable.
Screenshots
This is my last deploy. lastmod of the Chinese filename post (the encoded url one) changed to "now".
Your YAML file
name: github pages
on:
watch:
types: started
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
extended: true
- name: Build
# run: hugo -t beautifulhugo --minify
# run: hugo --minify --buildDrafts -t beautifulhugo --ignoreCache
run: hugo --minify -t beautifulhugo --ignoreCache
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: master
#github_token: ${{ secrets.GITHUB_TOKEN }}
personal_token: ${{ secrets.PERSONAL_TOKEN }}
publish_dir: ./public
external_repository: lingsamuel/lingsamuel.github.io
Additional context
Add any other context about the problem here.
lingsamuel commented
I found some potential related issue:
gohugoio/hugo#3071
gohugoio/hugo#6803
I tried this:
jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- name: disable quotePath
run: git config --global core.quotePath false # HERE
- uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
It works well now.
lingsamuel commented
@peaceiris I think you could add this to the README
github-actions commented