Skip to content

Update Leaderboard

Update Leaderboard #5

name: Update Leaderboard
on:
issues:
types: [opened]
jobs:
update_leaderboard:
if: startsWith(github.event.issue.title, 'Game Result Submission')
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Update leaderboard from comments
uses: actions/github-script@v7
with:
script: |
const updateLeaderboard = require('./.github/updateLeaderboard.js');
updateLeaderboard({github, context});
- name: Commit changes
run: |
git config --global user.name 'Github Actions'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add README.md
git commit -m ':sparkles: Update leaderboard' || echo "No changes to commit"
git push https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }} HEAD:main