-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (34 loc) · 1.16 KB
/
Copy pathstats.yml
File metadata and controls
42 lines (34 loc) · 1.16 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
42
name: Auto Update Stats Dashboard
on:
schedule:
- cron: '0 * * * *'
workflow_dispatch:
jobs:
run-stats-script:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14.6'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests matplotlib
- name: Run Stats Script
run: python stats/Stats_github_web.py
- name: Commit and Push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add stats/stats_database.json stats/stats_history.txt stats/*.png 2>/dev/null || true
# Если изменения есть, комитим, подтягиваем твои новые коммиты сверху и пушим
if ! git diff-index --quiet HEAD; then
git commit -m "Auto-update stats"
git pull --rebase origin main
git push
fi