From da6adf522734906b5de789c05d3a6a83e847e7f2 Mon Sep 17 00:00:00 2001 From: yyg-max <175597134+yyg-max@users.noreply.github.com> Date: Fri, 31 Jul 2026 15:12:08 +0800 Subject: [PATCH] chore(github): push daily chart SVGs to chart-assets branch instead of main --- .github/workflows/update-star-history.yml | 28 ++++++++++++----------- README.md | 8 +++---- README.zh-CN.md | 8 +++---- docs/images/contributors.svg | 1 - docs/images/star-history-dark.svg | 1 - docs/images/star-history-light.svg | 1 - 6 files changed, 23 insertions(+), 24 deletions(-) delete mode 100644 docs/images/contributors.svg delete mode 100644 docs/images/star-history-dark.svg delete mode 100644 docs/images/star-history-light.svg diff --git a/.github/workflows/update-star-history.yml b/.github/workflows/update-star-history.yml index e0966378e..7cfd0790c 100644 --- a/.github/workflows/update-star-history.yml +++ b/.github/workflows/update-star-history.yml @@ -13,6 +13,9 @@ concurrency: group: update-star-history cancel-in-progress: true +env: + ASSETS_BRANCH: chart-assets + jobs: update: if: github.repository == 'Stack-Cairn/LiveAgent' @@ -26,14 +29,15 @@ jobs: GH_TOKEN: ${{ secrets.STARGAZER_GH_TOKEN }} run: | set -euo pipefail + mkdir -p "$RUNNER_TEMP/charts" gh api --paginate --slurp \ --header "Accept: application/vnd.github.star+json" \ "repos/${GITHUB_REPOSITORY}/stargazers?per_page=100" \ > "$RUNNER_TEMP/stargazers.json" python3 scripts/update-star-history.py \ "$RUNNER_TEMP/stargazers.json" \ - docs/images/star-history-light.svg \ - docs/images/star-history-dark.svg + "$RUNNER_TEMP/charts/star-history-light.svg" \ + "$RUNNER_TEMP/charts/star-history-dark.svg" - name: Collect contributors env: @@ -45,24 +49,22 @@ jobs: > "$RUNNER_TEMP/contributors.json" python3 scripts/update-contributors.py \ "$RUNNER_TEMP/contributors.json" \ - docs/images/contributors.svg + "$RUNNER_TEMP/charts/contributors.svg" - name: Check chart files run: | set -euo pipefail - test -s docs/images/star-history-light.svg - test -s docs/images/star-history-dark.svg - test -s docs/images/contributors.svg + test -s "$RUNNER_TEMP/charts/star-history-light.svg" + test -s "$RUNNER_TEMP/charts/star-history-dark.svg" + test -s "$RUNNER_TEMP/charts/contributors.svg" - - name: Commit and push changes + - name: Push charts to assets branch run: | set -euo pipefail - git add README.md README.zh-CN.md docs/images/star-history-light.svg docs/images/star-history-dark.svg docs/images/contributors.svg - if git diff --cached --quiet; then - echo "README charts are unchanged." - exit 0 - fi + git switch --orphan "$ASSETS_BRANCH" + cp "$RUNNER_TEMP"/charts/*.svg . + git add star-history-light.svg star-history-dark.svg contributors.svg git config user.name "coder-hhx" git config user.email "houhaixu_email@163.com" git commit -m "docs: refresh star history and contributors charts" - git push + git push --force origin "$ASSETS_BRANCH" diff --git a/README.md b/README.md index 1eda2c7a3..1576098f0 100644 --- a/README.md +++ b/README.md @@ -407,7 +407,7 @@ Before submitting a PR, make sure all of the following checks pass (they match t Thanks to everyone who has contributed to LiveAgent! - Contributors + Contributors --- @@ -417,9 +417,9 @@ Thanks to everyone who has contributed to LiveAgent! - - - Star History Chart + + + Star History Chart diff --git a/README.zh-CN.md b/README.zh-CN.md index 2c47fb7fa..d62ab5daa 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -407,7 +407,7 @@ LiveAgent/ 感谢所有为 LiveAgent 做出贡献的朋友们! - Contributors + Contributors --- @@ -417,9 +417,9 @@ LiveAgent/ - - - Star History Chart + + + Star History Chart diff --git a/docs/images/contributors.svg b/docs/images/contributors.svg deleted file mode 100644 index 55b9b1916..000000000 --- a/docs/images/contributors.svg +++ /dev/null @@ -1 +0,0 @@ -su-fencoder-hhxAlphaCatMeowyyg-maxMieluoxxxinkdust202124baigeiBsyy95chenymeLoosandNotToday1024SaladDay45458976AnoyouKtzeAbyssferkans-amirhuanglj111Introl-ljlIslatrikumquatQSinclairLinzaixiaziyang \ No newline at end of file diff --git a/docs/images/star-history-dark.svg b/docs/images/star-history-dark.svg deleted file mode 100644 index 3aab4ee72..000000000 --- a/docs/images/star-history-dark.svg +++ /dev/null @@ -1 +0,0 @@ -Star History0500100015002000May 24Jun 04Jun 15Jun 27Jul 08Jul 19Jul 31stack-cairn/liveagentDateGitHub Stars \ No newline at end of file diff --git a/docs/images/star-history-light.svg b/docs/images/star-history-light.svg deleted file mode 100644 index 5eddcd629..000000000 --- a/docs/images/star-history-light.svg +++ /dev/null @@ -1 +0,0 @@ -Star History0500100015002000May 24Jun 04Jun 15Jun 27Jul 08Jul 19Jul 31stack-cairn/liveagentDateGitHub Stars \ No newline at end of file