改写图表生成逻辑

This commit is contained in:
2026-04-06 13:09:28 +08:00
parent e57a6fe90a
commit c896cd7705
2 changed files with 44 additions and 2 deletions
+42
View File
@@ -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
+2 -2
View File
@@ -74,8 +74,8 @@
## 📊 GitHub 统计
<p align="center">
<img src="https://github-readme-stats.vercel.app/api?username=daitcl&show_icons=true&theme=radical" alt="GitHub Stats" height="170" />
<img src="https://github-readme-stats.vercel.app/api/top-langs/?username=daitcl&layout=compact&theme=radical" alt="Top Langs" height="170" />
<img src="./profile/stats.svg" alt="GitHub Stats" height="170" />
<img src="./profile/top-langs.svg" alt="Top Langs" height="170" />
</p>
<p align="center">