返回 DeepSeek-Reasonix
update-star-history.yml
根目录 / .github / workflows / update-star-history.yml
1 name: Update Star History chart
2
3 on:
4 workflow_dispatch:
5 push:
6 branches:
7 - main-v2
8 paths:
9 - '.github/workflows/update-star-history.yml'
10 - 'scripts/update-star-history.mjs'
11 - 'scripts/update-star-history.test.mjs'
12 schedule:
13 - cron: '23 */3 * * *'
14
15 permissions:
16 contents: write
17
18 concurrency:
19 group: update-star-history
20 cancel-in-progress: false
21
22 jobs:
23 update:
24 if: github.repository == 'esengine/DeepSeek-Reasonix'
25 runs-on: ubuntu-latest
26 steps:
27 - uses: actions/checkout@v7
28 with:
29 fetch-depth: 0
30 - uses: actions/setup-node@v7
31 with:
32 node-version: '22'
33 - name: Test chart generator
34 run: node --test scripts/update-star-history.test.mjs
35 - name: Generate chart assets
36 env:
37 STAR_HISTORY_GITHUB_TOKEN: ${{ secrets.STAR_HISTORY_GITHUB_TOKEN }}
38 STAR_HISTORY_OUTPUT_DIR: ${{ runner.temp }}/star-history
39 run: node scripts/update-star-history.mjs
40 - name: Publish chart assets
41 env:
42 OUTPUT_DIR: ${{ runner.temp }}/star-history
43 TARGET_BRANCH: star-history
44 run: |
45 set -euo pipefail
46
47 git config user.name "github-actions[bot]"
48 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
49
50 if git fetch origin "$TARGET_BRANCH"; then
51 git switch --force-create "$TARGET_BRANCH" "origin/$TARGET_BRANCH"
52 else
53 git switch --create "$TARGET_BRANCH"
54 fi
55
56 mkdir -p assets/star-history
57 cp "$OUTPUT_DIR/star-history-light.svg" assets/star-history/star-history-light.svg
58 cp "$OUTPUT_DIR/star-history-dark.svg" assets/star-history/star-history-dark.svg
59 git add assets/star-history
60
61 if git diff --cached --quiet; then
62 echo "Star History chart is already current."
63 exit 0
64 fi
65
66 git commit \
67 -m "docs: update Star History chart" \
68 -m "Automated update:
69 Refresh the repository-hosted light and dark Star History SVGs from the authenticated GitHub stargazers API.
70
71 Verification:
72 - chart generator tests passed
73 - both SVG assets were rendered from timestamped stargazer data"
74 git push origin HEAD:"$TARGET_BRANCH"
75
75 lines YAML