File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1- name : Auto Update JSON-Dates
1+ name : Auto Update JSON-Dateien (new files only)
22
33on :
44 push :
2525 - name : Checkout repository
2626 uses : actions/checkout@v4
2727 with :
28- fetch-depth : 0 # Fetch full history for commit checks
28+ fetch-depth : 0 # Full history to check commit timestamps
2929
3030 - name : Set up Git
3131 run : |
@@ -36,11 +36,12 @@ jobs:
3636 id : find_new_json
3737 run : |
3838 TODAY=$(date -u +"%Y-%m-%d")
39- > new_json_files.txt
40-
4139 git fetch origin main --depth=1
40+ LATEST_COMMIT=$(git rev-parse origin/main)
41+
42+ > new_json_files.txt
4243
43- for FILE in $(git log --since="$TODAY 00:00:00" -- diff-filter=A --name-only --pretty=format: origin/main -- json/*.json || true ); do
44+ for FILE in $(git diff --diff-filter=A --name-only $LATEST_COMMIT -- json/); do
4445 COMMIT_DATE=$(git log --format=%cI -- "$FILE" | tail -n 1 | cut -dT -f1)
4546 if [[ "$COMMIT_DATE" == "$TODAY" ]]; then
4647 echo "$FILE" >> new_json_files.txt
5657 - name : Run update script
5758 if : env.CHANGED == 'true'
5859 run : |
59- chmod +x .github/workflows/ scripts/update-json.sh
60+ chmod +x .github/scripts/update-json.sh
6061 while read -r FILE; do
61- .github/workflows/ scripts/update-json.sh "$FILE"
62+ .github/scripts/update-json.sh "$FILE"
6263 done < new_json_files.txt
6364
6465 - name : Commit and create PR if changes exist
You can’t perform that action at this time.
0 commit comments