Skip to content

Commit 5e2fb47

Browse files
CopilotHackingGate
andauthored
Migrate to git last-modified for timestamp restoration (#20)
* Initial plan * Migrate to git-last-modified for restoring file timestamps Co-authored-by: HackingGate <[email protected]> * Fix git log command syntax by removing unnecessary -- Co-authored-by: HackingGate <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: HackingGate <[email protected]>
1 parent da6a2d0 commit 5e2fb47

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ jobs:
5353
} >> "$GITHUB_OUTPUT"
5454
- name: Generate sha256sums.txt
5555
run: sha256sum -b *.txt > sha256sums.txt
56-
- name: Run restore_last_git_modified_time.sh
57-
run: curl -sL https://gist.github.com/HackingGate/9e8169c7645b074b2f40c959ca20d738/raw/3ae3913f308d9cf34962ac3488b5973a2fbe1a95/restore_last_git_modified_time.sh | sh
56+
- name: Restore last modified times using git-last-modified
57+
run: |
58+
git last-modified --recursive | while IFS=$'\t' read -r commit file; do
59+
timestamp=$(git log --format=%at -1 "$commit")
60+
touch -d "@$timestamp" "$file"
61+
done
5862
- name: Generate index.html
5963
run: |
6064
tree -I 'CNAME' -H '.' -L 1 -h -D --timefmt '%Y-%m-%d %H:%M:%S %Z' --noreport --charset utf-8 -T 'Country IP Blocks' -o index.html

0 commit comments

Comments
 (0)