From 405dedf8cf1a15dcc74afb00f5cf6b86bb48d038 Mon Sep 17 00:00:00 2001 From: Chirag Jain Date: Fri, 5 Apr 2024 22:41:02 +0530 Subject: [PATCH] fix file timestamps --- .github/workflows/upload-blogs.yml | 5 +++++ blog/update-timestamps.sh | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100755 blog/update-timestamps.sh diff --git a/.github/workflows/upload-blogs.yml b/.github/workflows/upload-blogs.yml index b3f183f98..c61e52c73 100644 --- a/.github/workflows/upload-blogs.yml +++ b/.github/workflows/upload-blogs.yml @@ -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: | diff --git a/blog/update-timestamps.sh b/blog/update-timestamps.sh new file mode 100755 index 000000000..e1e14f3e7 --- /dev/null +++ b/blog/update-timestamps.sh @@ -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 \ No newline at end of file