Skip to content

Commit f6bc82e

Browse files
authored
Update update_json_date.yml
1 parent 5736b6a commit f6bc82e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/update_json_date.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Auto Update JSON-Dateien (new files only)
1+
name: Auto Update JSON-Dates
22

33
on:
44
push:
@@ -25,7 +25,7 @@ jobs:
2525
- name: Checkout repository
2626
uses: actions/checkout@v4
2727
with:
28-
fetch-depth: 0 # Fetch full history to check commit timestamps
28+
fetch-depth: 0 # Fetch full history for commit checks
2929

3030
- name: Set up Git
3131
run: |
@@ -38,7 +38,9 @@ jobs:
3838
TODAY=$(date -u +"%Y-%m-%d")
3939
> new_json_files.txt
4040
41-
for FILE in $(git ls-files --json | jq -r '.[]'); do
41+
git fetch origin main --depth=1
42+
43+
for FILE in $(git log --since="$TODAY 00:00:00" --diff-filter=A --name-only --pretty=format: origin/main -- json/*.json || true); do
4244
COMMIT_DATE=$(git log --format=%cI -- "$FILE" | tail -n 1 | cut -dT -f1)
4345
if [[ "$COMMIT_DATE" == "$TODAY" ]]; then
4446
echo "$FILE" >> new_json_files.txt

0 commit comments

Comments
 (0)