mirror of
https://github.com/LukeHagar/usage-statistics.git
synced 2025-12-06 04:21:55 +00:00
40 lines
1.0 KiB
YAML
40 lines
1.0 KiB
YAML
name: Collect Usage Stats
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 0 * * 1' # Every Monday at midnight UTC
|
|
workflow_dispatch: # Allow manual triggering
|
|
|
|
jobs:
|
|
stats:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v1
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
|
|
- name: Run collection script
|
|
run: bun run scripts/collect.ts
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
- name: Commit and push changes
|
|
run: |
|
|
git add README.md output/
|
|
git commit -m "chore: update usage statistics" || echo "No changes to commit"
|
|
git push |