update CI config #2
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 Time | |
permissions: | |
contents: write | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
update_time: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Add write permission to index.html | |
run: chmod +w index.html | |
- name: Update Time | |
run: | | |
sed -i "s#<p>更新时间:</p>#<p>更新时间:$(date +"%Y-%m-%d %H:%M:%S")</p>#" index.html | |
- name: Commit changes | |
run: | | |
git config --global user.name "LingyunAwA" | |
git config --global user.email "1913532130@qq.com" | |
git add index.html | |
git commit -m "[CI] Update time: $(date +"%Y-%m-%d %H:%M:%S")" | |
git push |