From c8ce305eaaa0764f42c1b051d38172322f44310f Mon Sep 17 00:00:00 2001 From: root Date: Tue, 7 Jul 2026 02:26:37 -0400 Subject: [PATCH] =?UTF-8?q?ci:=20=E5=89=94=E9=99=A4=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E6=8F=92=E4=BB=B6=EF=BC=8C=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E4=B8=BA=E9=AB=98=E5=8F=AF=E7=94=A8=E5=8E=9F=E7=94=9F?= =?UTF-8?q?=E5=8F=8C=E5=BC=95=E6=93=8E=E6=8B=89=E5=8F=96=E6=9E=B6=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/star_history.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/star_history.yml b/.github/workflows/star_history.yml index 353b102b..bf9796dc 100644 --- a/.github/workflows/star_history.yml +++ b/.github/workflows/star_history.yml @@ -12,16 +12,22 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 - - name: Generate Star History SVG - uses: dyte-io/star-history-action@v1.0.3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - output: 'data/star_history.svg' + - name: Fetch Star History SVG (Dual Engine) + run: | + mkdir -p data + echo "🚀 [Action] 正在尝试从主引擎拉取星标趋势图..." + HTTP_CODE=$(curl -sL -w "%{http_code}" "https://api.star-history.com/svg?repos=${{ github.repository }}&type=Date" -o data/star_history.svg) + + if [ "$HTTP_CODE" -ne 200 ]; then + echo "⚠️ [Warning] 主引擎响应异常 (HTTP $HTTP_CODE)!正在无缝切换至备用引擎..." + curl -sL "https://stars.medv.io/${{ github.repository }}.svg" -o data/star_history.svg + fi + echo "✅ [Success] 星标趋势图拉取完毕!" - name: Commit & Push Changes run: | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" git add data/star_history.svg - git commit -m "chore: 自动化更新 Star 趋势图" || exit 0 + git commit -m "chore: 自动化更新 Star 趋势图 (Native Curl 双擎版)" || exit 0 git push origin main