Repository navigation
75 lines (63 loc) · 2.95 KB
/
Copy pathdaily-update.yml
File metadata and controls
75 lines (63 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Daily update
on:
schedule:
# 02:23 UTC daily = 10:23 Beijing time
- cron: '23 2 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
# Full history: the sitemap rebuild stamps <lastmod> from per-file git
# dates; a shallow clone would silently drop (never fabricate) them.
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Refresh star counts and releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python scripts/update_readme.py
# Star-count changes alter table cell widths; realign so the blocking
# awesome-lint gate (table-pipe-alignment) stays green after every refresh.
- name: Realign README tables after the refresh
run: node scripts/format_tables.mjs README.md
- name: Rebuild the release feed from refreshed data
run: python scripts/build_feed.py
# The refresh also rewrites star spans inside compare/*.md, and CI's
# build_compare_html --check requires the published HTML to match its
# markdown source — so the same run must regenerate the pages.
- name: Rebuild compare pages from refreshed sources
run: python scripts/build_compare_html.py
# llms.txt embeds each compare page's Key-numbers line, which contains star
# counts — so the refresh also invalidates it. Regenerate here or CI fails
# on the next push (it did, twice).
- name: Rebuild llms.txt from refreshed sources
run: python scripts/build_llms_txt.py
- name: Commit if content changed
run: |
if git diff --quiet; then
echo "No content changes today."
else
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md README.zh-CN.md compare data/releases.json feed.xml sitemap.xml llms.txt
git commit -m "docs: daily refresh — stars & releases ($(date -u +%F))"
git push
fi
# Push the sitemap URLs to IndexNow so Bing (→ ~87% of ChatGPT Search
# citations) keeps them in its crawl queue. The key is public by design;
# non-blocking so a transient IndexNow hiccup never reds the daily job.
- name: Ping IndexNow (Bing/Yandex discovery)
run: python scripts/ping_indexnow.py
continue-on-error: true
# Blocking nag: the auto-refresh above keeps stars/releases current, but the
# pricing/scorecard snapshots are hand-reviewed. If they rot past 30 days the
# daily run goes red (the data is already pushed above) so the maintainer is
# prompted to actually re-review and bump 'as_of' — not to fake the date.
- name: Snapshots are still fresh
run: python scripts/check_freshness.py --max-age-days 30