Update star history #3
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: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "17 3 * * *" | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - ".github/scripts/generate_star_history.py" | |
| - ".github/workflows/update-star-history.yml" | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: update-star-history | |
| cancel-in-progress: true | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the default branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.repository.default_branch }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Generate star history charts | |
| env: | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: python .github/scripts/generate_star_history.py | |
| - name: Commit updated charts | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add assets/star-history.svg assets/star-history-dark.svg | |
| if git diff --cached --quiet; then | |
| echo "Star history is already up to date." | |
| exit 0 | |
| fi | |
| git commit -m "docs: update star history [skip ci]" | |
| git push origin "HEAD:${{ github.event.repository.default_branch }}" |