mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-01-26 18:46:18 +00:00
Update check_and_update_json_date.yml
This commit is contained in:
parent
70ab9ab09e
commit
d8931fef4d
@ -2,7 +2,7 @@ name: Check and Update JSON Date
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [synchronize, opened, edited]
|
types: [synchronize, opened, reopened, edited]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-date:
|
update-date:
|
||||||
@ -20,10 +20,10 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pip install jq
|
run: pip install jq
|
||||||
|
|
||||||
- name: Find and Update JSON files
|
- name: Find and Update JSON files in /json folder
|
||||||
run: |
|
run: |
|
||||||
TODAY=$(date +%Y-%m-%d)
|
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
|
if jq -e '.date_created' $file > /dev/null 2>&1; then
|
||||||
echo "Updating date_created in $file"
|
echo "Updating date_created in $file"
|
||||||
jq --arg date "$TODAY" '.date_created = $date' $file > temp.json && mv temp.json $file
|
jq --arg date "$TODAY" '.date_created = $date' $file > temp.json && mv temp.json $file
|
||||||
|
Loading…
Reference in New Issue
Block a user