diff --git a/.github/workflows/leaderboard.yml b/.github/workflows/leaderboard.yml index f3356f83..11f7787b 100644 --- a/.github/workflows/leaderboard.yml +++ b/.github/workflows/leaderboard.yml @@ -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 \ No newline at end of file