summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/stats.yml
blob: 8814c90f41147dc974e007b1df90f3da86afcd73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: stats

on:
  schedule:
    - cron: "0 12 * * *" # Run daily at 12:00 UTC
  workflow_dispatch: # Allow manual trigger

jobs:
  stats:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Bun
        uses: oven-sh/setup-bun@v2
        with:
          bun-version: latest

      - name: Run stats script
        run: bun scripts/stats.ts

      - name: Commit stats
        run: |
          git config --local user.email "[email protected]"
          git config --local user.name "GitHub Action"
          git add STATS.md
          git diff --staged --quiet || git commit -m "Update download stats $(date -I)"
          git push