diff --git a/.github/workflows/update-theme-date.yml b/.github/workflows/update-theme-date.yml index 71b0ad1e..f23fa9f7 100644 --- a/.github/workflows/update-theme-date.yml +++ b/.github/workflows/update-theme-date.yml @@ -1,13 +1,11 @@ name: Update Theme Timestamps on: - pull_request: - branches: - - main - types: [closed] push: branches: - main + paths: + - 'themes/**' jobs: update-timestamp: @@ -57,4 +55,5 @@ jobs: git add "themes/$theme/theme.json" done git commit -m "Update \`updated at\` field for \`$CHANGED_THEMES\`" - git push + git pull origin main --strategy-option=theirs + git push origin main diff --git a/scripts/rebuild_themes.py b/scripts/rebuild_themes.py index df6dba1d..c381f384 100644 --- a/scripts/rebuild_themes.py +++ b/scripts/rebuild_themes.py @@ -75,11 +75,12 @@ def main(): if "tags" not in theme_data: theme_data["tags"] = [] - # Add 'color theme' tag if colors.json is present - theme_data["tags"].append("color theme") + # Add 'color theme' tag if colors.json is present and tag isn't already in tags list + if "color scheme" not in theme_data["tags"]: + theme_data["tags"].append("color scheme") - # Add 'dark' tag if colors.json specifies dark mode - if "isDarkMode" in colors and colors["isDarkMode"]: + # Add 'dark' tag if colors.json specifies dark mode and tag isn't already in tags list + if "isDarkMode" in colors and colors["isDarkMode"] and "dark" not in theme_data["tags"]: theme_data["tags"].append("dark") themes_data[theme] = theme_data diff --git a/scripts/update_theme_date.py b/scripts/update_theme_date.py index 5d0259f8..021bee40 100644 --- a/scripts/update_theme_date.py +++ b/scripts/update_theme_date.py @@ -21,9 +21,23 @@ def update_theme_date(theme_path): theme_data = json.load(f) except json.JSONDecodeError as e: panic("Error reading theme.json: " + str(e)) + + # Get the current date + current_date = time.strftime("%Y-%m-%d") + + # Set `createdAt` to the current date if it doesn't exist + if "createdAt" not in theme_data: + theme_data["createdAt"] = current_date + print(f"Set `createdAt` for {theme_path} to {theme_data['createdAt']}") # Update the `updatedAt` field to the current date - theme_data["updatedAt"] = time.strftime("%Y-%m-%d") + theme_data["updatedAt"] = current_date + print(f"Updated `updatedAt` for {theme_path} to {theme_data['updatedAt']}") + + # Add `tags` as an empty list if it doesn't exist + if "tags" not in theme_data: + theme_data["tags"] = [] + print(f"Initialized `tags` for {theme_path} as an empty list") # Write the changes back to theme.json with open(theme_file, "w") as f: diff --git a/themes/253a3a74-0cc4-47b7-8b82-996a64f030d5/theme.json b/themes/253a3a74-0cc4-47b7-8b82-996a64f030d5/theme.json index d2bbd688..62150014 100644 --- a/themes/253a3a74-0cc4-47b7-8b82-996a64f030d5/theme.json +++ b/themes/253a3a74-0cc4-47b7-8b82-996a64f030d5/theme.json @@ -7,5 +7,7 @@ "readme": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/253a3a74-0cc4-47b7-8b82-996a64f030d5/readme.md", "image": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/253a3a74-0cc4-47b7-8b82-996a64f030d5/image.png", "author": "ahmaadaziz", + "createdAt": "2024-10-12", + "updatedAt": "2024-10-12", "version": "1.0.0" } \ No newline at end of file diff --git a/themes/4596d8f9-f0b7-4aeb-aa92-851222dc1888/theme.json b/themes/4596d8f9-f0b7-4aeb-aa92-851222dc1888/theme.json index b8d53784..b189ccef 100644 --- a/themes/4596d8f9-f0b7-4aeb-aa92-851222dc1888/theme.json +++ b/themes/4596d8f9-f0b7-4aeb-aa92-851222dc1888/theme.json @@ -8,5 +8,7 @@ "image": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/4596d8f9-f0b7-4aeb-aa92-851222dc1888/image.png", "author": "p-sw", "version": "1.0.0", + "tags": [], + "createdAt": "2024-10-12", "updatedAt": "2024-10-12" } \ No newline at end of file diff --git a/themes/4ab93b88-151c-451b-a1b7-a1e0e28fa7f8/theme.json b/themes/4ab93b88-151c-451b-a1b7-a1e0e28fa7f8/theme.json index f6cb622e..0c2d6345 100644 --- a/themes/4ab93b88-151c-451b-a1b7-a1e0e28fa7f8/theme.json +++ b/themes/4ab93b88-151c-451b-a1b7-a1e0e28fa7f8/theme.json @@ -10,5 +10,5 @@ "version": "1.0.2", "tags": [], "createdAt": "2024-09-01", - "updatedAt": "2024-09-07" + "updatedAt": "2024-10-12" } \ No newline at end of file diff --git a/themes/5c4d7772-d963-4672-ab03-e9d541438881/theme.json b/themes/5c4d7772-d963-4672-ab03-e9d541438881/theme.json index f08ee069..aa4ad222 100644 --- a/themes/5c4d7772-d963-4672-ab03-e9d541438881/theme.json +++ b/themes/5c4d7772-d963-4672-ab03-e9d541438881/theme.json @@ -8,5 +8,7 @@ "image": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/5c4d7772-d963-4672-ab03-e9d541438881/image.png", "author": "jvabn", "version": "1.0.0", + "tags": [], + "createdAt": "2024-10-12", "updatedAt": "2024-10-12" } \ No newline at end of file diff --git a/themes/5ca67725-1f43-4ff2-9fcf-0c59af71c73a/theme.json b/themes/5ca67725-1f43-4ff2-9fcf-0c59af71c73a/theme.json index a66461d8..489aa4b7 100644 --- a/themes/5ca67725-1f43-4ff2-9fcf-0c59af71c73a/theme.json +++ b/themes/5ca67725-1f43-4ff2-9fcf-0c59af71c73a/theme.json @@ -15,5 +15,5 @@ "dark" ], "createdAt": "2024-08-31", - "updatedAt": "" + "updatedAt": "2024-08-31" } \ No newline at end of file diff --git a/themes/664c54f9-d97d-410b-a479-23dd8a08a628/theme.json b/themes/664c54f9-d97d-410b-a479-23dd8a08a628/theme.json index d69256e0..9cec6d6f 100644 --- a/themes/664c54f9-d97d-410b-a479-23dd8a08a628/theme.json +++ b/themes/664c54f9-d97d-410b-a479-23dd8a08a628/theme.json @@ -9,5 +9,7 @@ "author": "TheRealMG", "version": "1.0.0", "preferences": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/664c54f9-d97d-410b-a479-23dd8a08a628/preferences.json", + "tags": [], + "createdAt": "2024-10-12", "updatedAt": "2024-10-12" } \ No newline at end of file diff --git a/themes/753c7518-237d-480a-abfd-1f42a7eabacc/theme.json b/themes/753c7518-237d-480a-abfd-1f42a7eabacc/theme.json index d769874d..808bf763 100644 --- a/themes/753c7518-237d-480a-abfd-1f42a7eabacc/theme.json +++ b/themes/753c7518-237d-480a-abfd-1f42a7eabacc/theme.json @@ -10,5 +10,5 @@ "version": "1.0.2", "tags": [], "createdAt": "2024-09-24", - "updatedAt": "2024-09-25" + "updatedAt": "2024-10-12" } \ No newline at end of file diff --git a/themes/7ba20fe1-7286-4b1f-9bf6-39d40bec8ae0/theme.json b/themes/7ba20fe1-7286-4b1f-9bf6-39d40bec8ae0/theme.json index 90330704..a0e57ea5 100644 --- a/themes/7ba20fe1-7286-4b1f-9bf6-39d40bec8ae0/theme.json +++ b/themes/7ba20fe1-7286-4b1f-9bf6-39d40bec8ae0/theme.json @@ -8,5 +8,7 @@ "image": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/7ba20fe1-7286-4b1f-9bf6-39d40bec8ae0/image.png", "author": "shaeriz", "version": "1.0.0", + "tags": [], + "createdAt": "2024-10-12", "updatedAt": "2024-10-12" } \ No newline at end of file diff --git a/themes/bb61b145-6875-4afe-86f2-ab00024459dc/theme.json b/themes/bb61b145-6875-4afe-86f2-ab00024459dc/theme.json index 9c3b6324..f0b106dd 100644 --- a/themes/bb61b145-6875-4afe-86f2-ab00024459dc/theme.json +++ b/themes/bb61b145-6875-4afe-86f2-ab00024459dc/theme.json @@ -8,5 +8,7 @@ "image": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/bb61b145-6875-4afe-86f2-ab00024459dc/image.png", "author": "mehalter", "version": "1.0.0", + "tags": [], + "createdAt": "2024-10-12", "updatedAt": "2024-10-12" } \ No newline at end of file diff --git a/themes/f7c71d9a-bce2-420f-ae44-a64bd92975ab/theme.json b/themes/f7c71d9a-bce2-420f-ae44-a64bd92975ab/theme.json index 4e256f54..955db991 100644 --- a/themes/f7c71d9a-bce2-420f-ae44-a64bd92975ab/theme.json +++ b/themes/f7c71d9a-bce2-420f-ae44-a64bd92975ab/theme.json @@ -1 +1,14 @@ -{"id": "f7c71d9a-bce2-420f-ae44-a64bd92975ab", "name": "Better Unloaded Tabs", "description": "Makes unloaded tabs easier to notice by making them greyscale and transparent.", "homepage": "https://github.com/Felkazz/zen-browser-better-unloaded-tabs", "style": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/f7c71d9a-bce2-420f-ae44-a64bd92975ab/chrome.css", "readme": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/f7c71d9a-bce2-420f-ae44-a64bd92975ab/readme.md", "image": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/f7c71d9a-bce2-420f-ae44-a64bd92975ab/image.png", "author": "Felkazz", "version": "1.0.1", "updatedAt": "2024-10-12"} \ No newline at end of file +{ + "id": "f7c71d9a-bce2-420f-ae44-a64bd92975ab", + "name": "Better Unloaded Tabs", + "description": "Makes unloaded tabs easier to notice by making them greyscale and transparent.", + "homepage": "https://github.com/Felkazz/zen-browser-better-unloaded-tabs", + "style": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/f7c71d9a-bce2-420f-ae44-a64bd92975ab/chrome.css", + "readme": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/f7c71d9a-bce2-420f-ae44-a64bd92975ab/readme.md", + "image": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/f7c71d9a-bce2-420f-ae44-a64bd92975ab/image.png", + "author": "Felkazz", + "version": "1.0.1", + "tags": [], + "createdAt": "2024-10-12", + "updatedAt": "2024-10-12" +} \ No newline at end of file