11name : Update Leaderboard
22
33on :
4- workflow_dispatch :
5- schedule :
6- - cron : ' 0 * * * *'
4+ workflow_dispatch :
5+ schedule :
6+ - cron : ' 0 * * * *'
77
88permissions :
9- contents : write
10- pull-requests : read
11- issues : read
9+ contents : write
10+ pull-requests : read
11+ issues : read
1212
1313jobs :
14- leaderboard :
15- runs-on : ubuntu-latest
16-
17- steps :
18- - name : Checkout
19- uses : actions/checkout@v4
20-
21- - name : Setup Node
22- uses : actions/setup-node@v4
23- with :
24- node-version : 22
25-
26- - name : Generate leaderboard
27- uses : actions/github-script@v7
28- with :
29- github-token : ${{ secrets.GITHUB_TOKEN }}
30- script : |
31- const script = require('./.github/scripts/generateLeaderboard.js');
32- await script({ github, context });
33-
34- - name : Commit leaderboard
35- run : |
36- git config user.name "github-actions[bot]"
37- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
38-
39- git add public/leaderboard.json
40-
41- if git diff --staged --quiet; then
42- echo "No changes to commit"
43- exit 0
44- fi
45-
46- git commit -m "chore: update leaderboard"
47- git push
48-
14+ leaderboard :
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ - name : Checkout
19+ uses : actions/checkout@v4
20+
21+ - name : Setup Node
22+ uses : actions/setup-node@v4
23+ with :
24+ node-version : 22
25+
26+ - name : Generate leaderboard
27+ uses : actions/github-script@v7
28+ with :
29+ github-token : ${{ secrets.GITHUB_TOKEN }}
30+ script : |
31+ const script = require('./.github/scripts/generateLeaderboard.js');
32+ await script({ github, context });
33+
34+ - name : Commit leaderboard
35+ run : |
36+ git config user.name "github-actions[bot]"
37+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
38+
39+ git add public/leaderboard.json
40+
41+ if git diff --staged --quiet; then
42+ echo "No changes to commit"
43+ exit 0
44+ fi
45+
46+ git commit -m "chore: update leaderboard"
47+ git push
0 commit comments