This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Timestamps | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
update-timestamps: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Update timestamps in README.md | |
run: | | |
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") | |
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 | |
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 |