Skip to content

Git history is overriden by the build process #149

@Thomasorus

Description

@Thomasorus

Behaviour

I built a static site generator in python and use the git commit history of markdown files to display a "Last modified" date on the built website. When used locally, my build process works and display the date correctly.

But when I used this github action, the git history seems to disappear entirely and the date displayed is the built date,

Demo files

  1. You can see that this file last modification is may 24.
  2. But the built page shows May 29, the last time the site was built.

Expected behaviour

The date on the built page should be may 24.

Actual behaviour

The date on the built page is May 29,

Configuration

name: website

on: push

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Generate Chisai
        run: python3 src/build.py --prod
      #-
        #name: Create cname file
        # run: echo 'mydomain.com' > build/CNAME
      -
        name: Deploy to GitHub Pages
        if: success()
        uses: crazy-max/ghaction-github-pages@v2
        with:
          target_branch: gh-pages
          build_dir: build
          keep_history: false
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Logs

1_publish.txt

Thanks for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions