Merge pull request #15 from wuyoscar/update/2026-03-26 #4
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: Update Leaderboard Chart | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'assets/leaderboard_history.json' | |
| jobs: | |
| generate-chart: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v4 | |
| - name: Generate chart | |
| run: uv run scripts/gen_leaderboard_chart.py | |
| - name: Create PR if changed | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add assets/leaderboard_progress.svg | |
| if git diff --staged --quiet; then | |
| echo "No changes to chart" | |
| else | |
| BRANCH="auto/chart-update-$(date +%Y%m%d-%H%M%S)" | |
| git checkout -b "$BRANCH" | |
| git commit -m "chore: auto-update leaderboard chart" | |
| git push -u origin "$BRANCH" | |
| gh pr create --title "chore: auto-update leaderboard chart" \ | |
| --body "Auto-generated by GitHub Actions after leaderboard_history.json change." \ | |
| --base main --head "$BRANCH" | |
| fi | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |