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!
-
+
---
@@ -417,9 +417,9 @@ Thanks to everyone who has contributed to LiveAgent!
-
-
-
+
+
+
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 做出贡献的朋友们!
-
+
---
@@ -417,9 +417,9 @@ LiveAgent/
-
-
-
+
+
+
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 @@
-
\ 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 @@
-
\ 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 @@
-
\ No newline at end of file