Skip to content

Generate GitHub Stats SVGs #101

Generate GitHub Stats SVGs

Generate GitHub Stats SVGs #101

name: Generate GitHub Stats SVGs
on:
schedule:
- cron: '0 */6 * * *' # every 6 hours
workflow_dispatch:
permissions:
contents: write
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Generate stats SVGs
run: node .github/scripts/generate-stats.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit updated SVGs
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add public/stats/
git diff --cached --quiet || (git commit -m "chore: update GitHub stats SVGs" && git push)