Challenge Leaderboard #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |