From d8931fef4d622423e97b95e656bd9dc540564866 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Fri, 10 Jan 2025 14:20:42 +0100 Subject: [PATCH] Update check_and_update_json_date.yml --- .github/workflows/check_and_update_json_date.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check_and_update_json_date.yml b/.github/workflows/check_and_update_json_date.yml index b2ff16e2..3b72eb7a 100644 --- a/.github/workflows/check_and_update_json_date.yml +++ b/.github/workflows/check_and_update_json_date.yml @@ -2,7 +2,7 @@ name: Check and Update JSON Date on: pull_request: - types: [synchronize, opened, edited] + types: [synchronize, opened, reopened, edited] jobs: update-date: @@ -20,10 +20,10 @@ jobs: - name: Install dependencies run: pip install jq - - name: Find and Update JSON files + - name: Find and Update JSON files in /json folder run: | TODAY=$(date +%Y-%m-%d) - for file in $(git diff --diff-filter=A --name-only HEAD | grep '\.json$'); do + for file in $(git diff --diff-filter=A --name-only HEAD | grep '^json/.*\.json$'); do if jq -e '.date_created' $file > /dev/null 2>&1; then echo "Updating date_created in $file" jq --arg date "$TODAY" '.date_created = $date' $file > temp.json && mv temp.json $file