Files
lyogavin--airllm/.github/workflows/star-history.yml
T
2026-07-13 12:40:44 +08:00

41 lines
1.3 KiB
YAML

name: Refresh Star History
# Regenerates assets/star-history.png daily and commits it if it changed.
# We render the chart ourselves from the authenticated GitHub API (see
# scripts/gen_star_history.py) instead of embedding the anonymous
# star-history.com SVG API, which is rate-limited and returns an empty chart
# for large repos. The README embeds the committed PNG, so it always renders.
on:
schedule:
- cron: "0 6 * * *" # daily at 06:00 UTC
workflow_dispatch:
jobs:
refresh:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: python -m pip install --upgrade matplotlib
- name: Generate star history charts (light + dark)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/gen_star_history.py "${{ github.repository }}" assets/star-history.png light
python scripts/gen_star_history.py "${{ github.repository }}" assets/star-history-dark.png dark
- name: Commit if changed
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: refresh star history chart"
file_pattern: "assets/star-history.png assets/star-history-dark.png"