From c896cd770538862bc0b93bd0b32b879d66af90a1 Mon Sep 17 00:00:00 2001 From: daitcl <354769733@qq.com> Date: Mon, 6 Apr 2026 13:09:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=86=99=E5=9B=BE=E8=A1=A8=E7=94=9F?= =?UTF-8?q?=E6=88=90=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/stats.yml | 42 +++++++++++++++++++++++++++++++++++++ README.md | 4 ++-- 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/stats.yml diff --git a/.github/workflows/stats.yml b/.github/workflows/stats.yml new file mode 100644 index 0000000..2f7dd00 --- /dev/null +++ b/.github/workflows/stats.yml @@ -0,0 +1,42 @@ +name: Update README cards + +on: + schedule: + - cron: "0 3 * * *" # 每天 UTC 3:00 更新 + workflow_dispatch: # 支持手动触发 + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + # 生成统计卡片 + - name: Generate stats card + uses: readme-tools/github-readme-stats-action@v1 + with: + card: stats + options: username=${{ github.repository_owner }}&show_icons=true + path: profile/stats.svg + token: ${{ secrets.GITHUB_TOKEN }} + + # 生成语言占比卡片 + - name: Generate top languages card + uses: readme-tools/github-readme-stats-action@v1 + with: + card: top-langs + options: username=${{ github.repository_owner }}&layout=compact&langs_count=6 + path: profile/top-langs.svg + token: ${{ secrets.GITHUB_TOKEN }} + + # 提交生成的卡片到仓库 + - name: Commit cards + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add profile/*.svg + git commit -m "Update README cards" || exit 0 + git push \ No newline at end of file diff --git a/README.md b/README.md index bf775c6..0474cc5 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,8 @@ ## 📊 GitHub 统计

- GitHub Stats - Top Langs + GitHub Stats + Top Langs