mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 02:12:49 +00:00 
			
		
		
		
	Update check_and_update_json_date.yml
This commit is contained in:
		@@ -33,11 +33,15 @@ jobs:
 | 
				
			|||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          TODAY=$(date -u +%Y-%m-%d)
 | 
					          TODAY=$(date -u +%Y-%m-%d)
 | 
				
			||||||
          for json_file in $(find . -type f -name "*.json"); do
 | 
					          for json_file in $(find . -type f -name "*.json"); do
 | 
				
			||||||
            jq --arg today "$TODAY" '.date_created = $today' "$json_file" > tmp.json && mv tmp.json "$json_file"
 | 
					            # Ensure the JSON structure is an object
 | 
				
			||||||
 | 
					            if jq -e 'type == "object"' "$json_file" > /dev/null 2>&1; then
 | 
				
			||||||
 | 
					              # Update the date_created field
 | 
				
			||||||
 | 
					              jq --arg today "$TODAY" '.date_created = $today' "$json_file" > tmp.json && mv tmp.json "$json_file"
 | 
				
			||||||
 | 
					            fi
 | 
				
			||||||
          done
 | 
					          done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Commit changes
 | 
					      - name: Commit changes
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          git add *.json
 | 
					          git add *.json
 | 
				
			||||||
          git commit -m "Update date_created in JSON files to $TODAY"
 | 
					          git commit -m "Update date_created to $TODAY"
 | 
				
			||||||
          git push origin main
 | 
					          git push origin main
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user