forked from Ikalus1988/MisakaNet
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) 路 991 Bytes
/
Copy pathleaderboard-watch.yml
File metadata and controls
40 lines (34 loc) 路 991 Bytes
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
name: Leaderboard Watch
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
issues: write
jobs:
watch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Compute and compare leaderboard
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python3 scripts/leaderboard_watch.py 2>&1
- name: Commit updated leaderboard snapshot
run: |
if [ -f data/leaderboard.json ]; then
git config user.name "misakanet-bot"
git config user.email "bot@misakanet.org"
git add data/leaderboard.json
git diff --cached --quiet || git commit -s -m "chore: update leaderboard snapshot [skip ci]"
git pull --rebase origin main || true
git push
fi