-
Notifications
You must be signed in to change notification settings - Fork 6
45 lines (38 loc) · 1.27 KB
/
update-timestamp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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