Skip to content

Merge pull request #15 from wuyoscar/update/2026-03-26 #4

Merge pull request #15 from wuyoscar/update/2026-03-26

Merge pull request #15 from wuyoscar/update/2026-03-26 #4

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 }}