Skip to content

feat: Leaderboard yaml #2

feat: Leaderboard yaml

feat: Leaderboard yaml #2

Workflow file for this run

name: Update Leaderboard

Check failure on line 1 in .github/workflows/leaderboard.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/leaderboard.yml

Invalid workflow file

(Line: 3, Col: 4): Unexpected value '', (Line: 4, Col: 1): Unexpected value 'workflow_dispatch', (Line: 5, Col: 1): Unexpected value 'schedule', (Line: 8, Col: 13): Unexpected value '', (Line: 9, Col: 1): Unexpected value 'contents', (Line: 10, Col: 1): Unexpected value 'pull-requests', (Line: 11, Col: 1): Unexpected value 'issues', (Line: 13, Col: 6): Unexpected value '', (Line: 14, Col: 1): Unexpected value 'leaderboard', (Line: 15, Col: 1): Unexpected value 'runs-on'
on:
workflow_dispatch:
schedule:
- cron: '0 * * * *'
permissions:
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