Update Star History & Contributors #1
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: "17 * * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: update-star-history | |
| cancel-in-progress: true | |
| jobs: | |
| update: | |
| if: github.repository == 'Stack-Cairn/LiveAgent' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Refresh chart cache key | |
| run: | | |
| set -euo pipefail | |
| cache_key="$(date -u +%Y-%m-%d-%H)" | |
| sed -i -E "s/cache=[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}/cache=${cache_key}/g" README.md README.zh-CN.md | |
| matches="$(grep -ho "cache=${cache_key}" README.md README.zh-CN.md | wc -l)" | |
| test "$matches" -eq 6 | |
| - name: Commit and push changes | |
| run: | | |
| set -euo pipefail | |
| if git diff --quiet -- README.md README.zh-CN.md; then | |
| echo "Star History cache key is already current." | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add README.md README.zh-CN.md | |
| git commit -m "docs: refresh star history chart" | |
| git push |