stats.yml 889 B

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