stats.yml 769 B

1234567891011121314151617181920212223242526272829303132
  1. name: stats
  2. on:
  3. schedule:
  4. - cron: "0 12 * * *" # Run daily at 12:00 UTC
  5. workflow_dispatch: # Allow manual trigger
  6. jobs:
  7. stats:
  8. runs-on: ubuntu-latest
  9. permissions:
  10. contents: write
  11. steps:
  12. - name: Checkout
  13. uses: actions/checkout@v4
  14. - name: Setup Bun
  15. uses: ./.github/actions/setup-bun
  16. - name: Run stats script
  17. run: bun script/stats.ts
  18. - name: Commit stats
  19. run: |
  20. git config --local user.email "[email protected]"
  21. git config --local user.name "GitHub Action"
  22. git add STATS.md
  23. git diff --staged --quiet || git commit -m "ignore: update download stats $(date -I)"
  24. git push
  25. env:
  26. POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }}