Skip to content

Challenge Leaderboard #31

Challenge Leaderboard

Challenge Leaderboard #31

Workflow file for this run

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