-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.05 KB
/
update-stats.yml
File metadata and controls
41 lines (35 loc) · 1.05 KB
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
31
32
33
34
35
36
37
38
39
40
41
name: Update GitHub Stats
on:
schedule:
# Run every Sunday at midnight UTC
- cron: "0 0 * * 0"
workflow_dispatch: # Allow manual trigger
permissions:
contents: write
jobs:
update-stats:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Run stats update
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Run multiple times to handle rate limiting
for i in {1..5}; do
echo "=== Run $i ==="
python3 scripts/update_stats.py
sleep 60
done
- name: Commit and push if changed
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add data/stats.json
git diff --staged --quiet || git commit -m "📊 Update GitHub stats [automated]"
git push