Skip to content

Commit

Permalink
fix file timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
chirag-jn committed Apr 5, 2024
1 parent 530252a commit 405dedf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/upload-blogs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Set file timestamps
run: |
./blog/update-timestamps.sh
shell: bash

- name: Set STRAPI secrets
run: |
Expand Down
9 changes: 9 additions & 0 deletions blog/update-timestamps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# Loop through all tracked files
git ls-tree -r --name-only HEAD | while read filename; do
# Get the last commit date for this file
last_commit_date=$(git log -1 --format="%ai" -- "$filename")
# Use 'touch' to update the file's timestamp
touch -d "$last_commit_date" "$filename"
done

0 comments on commit 405dedf

Please sign in to comment.