From d969cd08daef2ee3af4dac2e92df35e35fd0c6f3 Mon Sep 17 00:00:00 2001 From: sang765 <80249864+sang765@users.noreply.github.com> Date: Thu, 20 Jun 2024 23:26:33 +0700 Subject: [PATCH] Fix --- .github/workflows/update-timestamp.yml | 21 ++++++--------------- README.md | 8 ++++---- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/workflows/update-timestamp.yml b/.github/workflows/update-timestamp.yml index 2f21b5d..6fbc539 100644 --- a/.github/workflows/update-timestamp.yml +++ b/.github/workflows/update-timestamp.yml @@ -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: themes/addons.css: themes/ThemeAddons/ClearVersionV6Icon.addon.css: themes/ThemeAddons/IconColors.addon.css:" 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 "action@github.com" git config --local user.name "GitHub Action" git add README.md git commit -m "Update timestamps" - git push + git push \ No newline at end of file diff --git a/README.md b/README.md index ab37bde..8171407 100644 --- a/README.md +++ b/README.md @@ -28,13 +28,13 @@ ## 🎈 Status ### Last updated: -Last updated for **Theme (Dark)**: +Last updated for themes/Ancord.dark.css:
-Last updated for **Addons List**: +Last updated for themes/addons.css:
-Last updated for **Clear Vesion V6 Icon (Addon)**: +Last updated for themes/ThemeAddons/ClearVersionV6Icon.addon.css:
-Last updated for **Icon Color (Addon)**: +Last updated for themes/ThemeAddons/IconColors.addon.css: ## 🖼️ Screenshots: >[!NOTE]