-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.54 KB
/
leaderboard.yml
File metadata and controls
52 lines (45 loc) · 1.54 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
46
47
48
49
50
51
52
name: Contributions Leaderboard
on:
# Run every day at 02:00 UTC
schedule:
- cron: '0 2 * * *'
# Also allow manual triggering and trigger on push to main/master
push:
branches:
- main
- master
workflow_dispatch:
jobs:
leaderboard:
name: Generate Leaderboard
runs-on: ubuntu-latest
permissions:
contents: write # needed to commit & push LEADERBOARD.md
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Use a token with org-wide read access so we can query all repos.
# Fall back to the built-in GITHUB_TOKEN for single-repo usage.
token: ${{ secrets.LEADERBOARD_TOKEN || secrets.GITHUB_TOKEN }}
- 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
OUTPUT_FILE: LEADERBOARD.md
run: node .github/scripts/generate-leaderboard.js
- name: Commit and push LEADERBOARD.md
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.md – nothing to commit."
else
git commit -m "chore: update contributions leaderboard [skip ci]"
git push
fi