-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (39 loc) · 1.18 KB
/
leaderboard.yml
File metadata and controls
45 lines (39 loc) · 1.18 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
43
44
45
name: Challenge Leaderboard
on:
schedule:
- cron: '0 2 * * *' # daily at 02:00 UTC
push:
branches:
- main
- master
workflow_dispatch:
jobs:
leaderboard:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Generate leaderboard
env:
GITHUB_TOKEN: ${{ secrets.LEADERBOARD_TOKEN || secrets.GITHUB_TOKEN }}
ORG: ReactSphere
REPO: reactsphere-community-challenges
OUTPUT_FILE: LEADERBOARD.md
run: node .github/scripts/generate-leaderboard.js
- name: Commit & push leaderboard
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add LEADERBOARD.md
if git diff --cached --quiet; then
echo "No changes to leaderboard – nothing to commit."
else
git commit -m "chore: update challenge leaderboard [skip ci]"
git push
fi