Update profile statistics #11
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 profile statistics | |
| on: | |
| schedule: | |
| - cron: "41 2 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| generate: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Check out profile repository | |
| uses: actions/checkout@v4 | |
| - name: Generate statistics SVGs | |
| run: node scripts/generate-profile-stats.mjs | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PROFILE_USERNAME: ${{ github.repository_owner }} | |
| - name: Commit updated statistics | |
| run: | | |
| if git diff --quiet -- assets/github-stats-*.svg assets/top-languages-*.svg; then | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add assets/github-stats-*.svg assets/top-languages-*.svg | |
| git commit -m "Update profile statistics" | |
| git push |