X:: [[GitHub Actions]], [[Git]] I have a [GitHub Actions Workflow](https://github.com/tjpalanca/tjpalanca.github.io/blob/master/.github/workflows/publish.yml) that clones the repo, renders the content, then pushes it up to the `gh-pages` branch to be published. However, the ordering of the field notes was dependent on the file modicaition timestamps. I imagine workflows that use Make will also be affected by this issue. I needed a solution that restored the modification timestamps after the repo is cloned. I chanced upon [`git-tools`](https://github.com/MestreLion/git-tools) which contained a utility called `git-restore-mtime` that served this purpose perfectly. I just needed to add a step to install and execute after cloning, and ensure that the checkout action cloned the full repo by setting `fetch-depth` to `0`.[^1] ```yaml - name: Check out repository uses: actions/checkout@v2 with: fetch-depth: 0 - name: Restore modification timestamps run: sudo apt-get install -y git-restore-mtime && git restore-mtime ``` Note that this requires `git` and a modern `python` version. GitHub Actions does come with Python preinstalled, so this works well. [^1]: I presume that the modification times are taken from the git log, but I may be mistaken.