We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d0632f commit 757b5bdCopy full SHA for 757b5bd
.github/workflows/update_json_date.sh1
@@ -0,0 +1,23 @@
1
+#!/usr/bin/env bash
2
+
3
+# Verzeichnis, das die JSON-Dateien enthält
4
+json_dir="./json/*.json"
5
6
+current_date=$(date +"%Y-%m-%d")
7
8
+for json_file in $json_dir; do
9
+ if [[ -f "$json_file" ]]; then
10
+ current_json_date=$(jq -r '.date_created' "$json_file")
11
12
+ if [[ "$current_json_date" != "$current_date" ]]; then
13
+ echo "Updating $json_file with date $current_date"
14
+ jq --arg date "$current_date" '.date_created = $date' "$json_file" > temp.json && mv temp.json "$json_file"
15
16
+ git add "$json_file"
17
+ git commit -m "Update date_created to $current_date in $json_file"
18
+ else
19
+ echo "Date in $json_file is already up to date."
20
+ fi
21
22
+done
23
+git push origin HEAD
0 commit comments