Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 40 additions & 41 deletions .github/workflows/leaderboard.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,47 @@
name: Update Leaderboard

on:
workflow_dispatch:
schedule:
- cron: '0 * * * *'
workflow_dispatch:
schedule:
- cron: '0 * * * *'

permissions:
contents: write
pull-requests: read
issues: read
contents: write
pull-requests: read
issues: read

jobs:
leaderboard:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Generate leaderboard
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const script = require('./.github/scripts/generateLeaderboard.js');
await script({ github, context });

- name: Commit leaderboard
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

git add public/leaderboard.json

if git diff --staged --quiet; then
echo "No changes to commit"
exit 0
fi

git commit -m "chore: update leaderboard"
git push

leaderboard:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Generate leaderboard
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const script = require('./.github/scripts/generateLeaderboard.js');
await script({ github, context });

- name: Commit leaderboard
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

git add public/leaderboard.json

if git diff --staged --quiet; then
echo "No changes to commit"
exit 0
fi

git commit -m "chore: update leaderboard"
git push