Update Star History #4
This file contains hidden or 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 Star History | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # 每天 UTC 00:00 运行 | |
| workflow_dispatch: | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Update date parameter in READMEs | |
| run: | | |
| DATE=$(date +%Y%m%d) | |
| sed -i "s/&t=[0-9]\{8\}/\&t=${DATE}/g" README.md README_zh.md | |
| - name: Commit and push if changed | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git diff --quiet && exit 0 | |
| git add README.md README_zh.md | |
| git commit -m "chore: refresh star history chart [skip ci]" | |
| git push |