From bbe145cb3659fb1a709aa854197496c9eae6f7d5 Mon Sep 17 00:00:00 2001 From: Vinta Chen Date: Wed, 18 Mar 2026 22:18:04 +0800 Subject: [PATCH] ci: add workflow to fetch and commit GitHub stars daily Runs on a nightly schedule, installs deps with uv, calls make fetch_github_stars, and pushes an update commit only when the star data file actually changed. Co-Authored-By: Claude --- .github/workflows/fetch-github-stars.yml | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/fetch-github-stars.yml diff --git a/.github/workflows/fetch-github-stars.yml b/.github/workflows/fetch-github-stars.yml new file mode 100644 index 00000000..0c7aba56 --- /dev/null +++ b/.github/workflows/fetch-github-stars.yml @@ -0,0 +1,39 @@ +name: Fetch GitHub Stars + +on: + schedule: + - cron: "0 0 * * *" + +permissions: + contents: write + +jobs: + fetch: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + enable-cache: true + + - name: Install dependencies + run: uv sync --group build + + - name: Fetch GitHub stars + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: make fetch_github_stars + + - name: Commit updated star data + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add website/data/github_stars.json + if ! git diff --cached --quiet; then + git commit -m "chore: update GitHub stars data" + git push + fi