Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sang765 committed Jun 20, 2024
1 parent ad559af commit d969cd0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/update-timestamp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,17 @@ jobs:

- name: Update timestamps in README.md
run: |
declare -A TARGET_FILES
TARGET_FILES=(
["**Theme (Dark)**"]="themes/Ancord.dark.css"
["**Addons List**"]="themes/addons.css"
["**Clear Vesion V6 Icon (Addon)**"]="themes/ThemeAddons/ClearVersionV6Icon.addon.css"
["**Icon Color (Addon)**"]="themes/ThemeAddons/IconColors.addon.css"
)
TARGET_FILES="themes/Ancord.dark.css:<timestamp-placeholder-1> themes/addons.css:<timestamp-placeholder-2> themes/ThemeAddons/ClearVersionV6Icon.addon.css:<timestamp-placeholder-3> themes/ThemeAddons/IconColors.addon.css:<timestamp-placeholder-4>"
TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
for key in "${!TARGET_FILES[@]}"; do
FILE_PATH=${TARGET_FILES[$key]}
if [ -f "$FILE_PATH" ]; then
sed -i "s|Last updated for $key: .*|Last updated for $key: $TIMESTAMP|" README.md
fi
IFS=' ' read -r -a files <<< "$TARGET_FILES"
for item in "${files[@]}"; do
file_path="${item%%:*}"
sed -i "s|Last updated for **${file_path}**: .*|Last updated for **${file_path}**: ${TIMESTAMP}|" README.md
done
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md
git commit -m "Update timestamps"
git push
git push
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
## 🎈 Status
### Last updated:
Last updated for **Theme (Dark)**: <timestamp-placeholder-1>
Last updated for themes/Ancord.dark.css: <timestamp-placeholder-1>
<br>
Last updated for **Addons List**: <timestamp-placeholder-2>
Last updated for themes/addons.css: <timestamp-placeholder-2>
<br>
Last updated for **Clear Vesion V6 Icon (Addon)**: <timestamp-placeholder-3>
Last updated for themes/ThemeAddons/ClearVersionV6Icon.addon.css: <timestamp-placeholder-3>
<br>
Last updated for **Icon Color (Addon)**: <timestamp-placeholder-4>
Last updated for themes/ThemeAddons/IconColors.addon.css: <timestamp-placeholder-4>

## 🖼️ Screenshots:
>[!NOTE]
Expand Down

0 comments on commit d969cd0

Please sign in to comment.