Skip to content

Update update-timestamp.yml #4

Update update-timestamp.yml

Update update-timestamp.yml #4

name: Update Timestamps
on:
push:
branches:
- main
jobs:
update-timestamps:
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Checkout repository
uses: actions/[email protected]
- 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"
)
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
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