fix(readme): Sync star badge and milestone text

Fix the README star badge replacement pattern so encoded badge values update correctly during metadata sync.

Also align the README release summary copy with the computed star milestone to avoid stale stargazer text after sync.
This commit is contained in:
sickn33
2026-03-21 10:25:34 +01:00
parent c45b51a8c4
commit 37f46505ff
3 changed files with 16 additions and 4 deletions

View File

@@ -54,6 +54,7 @@ def count_documented_bundles(content: str) -> int:
def sync_readme_copy(content: str, metadata: dict) -> str:
star_celebration = metadata.get("star_celebration", "25k")
replacements = [
(
README_TAGLINE_RE,
@@ -65,7 +66,7 @@ def sync_readme_copy(content: str, metadata: dict) -> str:
(
README_RELEASE_RE,
(
f"**Current release: V{metadata['version']}.** Trusted by 25k+ GitHub stargazers, "
f"**Current release: V{metadata['version']}.** Trusted by {star_celebration}+ GitHub stargazers, "
"this repository combines official and community skill collections with bundles, "
"workflows, installation paths, and docs that help you go from first install to daily use quickly."
),

View File

@@ -15,6 +15,7 @@ SYNC_COMMENT_FIELDS_RE = re.compile(
r"<!-- registry-sync: version=(?P<version>[^;]+); skills=(?P<skills>\d+); "
r"stars=(?P<stars>\d+); updated_at=(?P<updated_at>[^ ]+) -->"
)
CURRENT_RELEASE_LINE_RE = re.compile(r"^\*\*Current release: V[\d.]+\.\*\* .*?$", re.MULTILINE)
def configure_utf8_output() -> None:
@@ -206,11 +207,21 @@ def apply_metadata(content: str, metadata: dict) -> str:
flags=re.MULTILINE,
)
content = re.sub(
r"https://img\.shields\.io/badge/⭐%20[\d%2C\+]+%20Stars-gold\?style=for-the-badge",
r"https://img\.shields\.io/badge/⭐%20[\dA-Fa-f%,\+]+%20Stars-gold\?style=for-the-badge",
f"https://img.shields.io/badge/⭐%20{star_badge_count}%20Stars-gold?style=for-the-badge",
content,
count=1,
)
content = re.sub(
CURRENT_RELEASE_LINE_RE,
(
f"**Current release: V{version}.** Trusted by {star_celebration}+ GitHub stargazers, "
"this repository combines official and community skill collections with bundles, "
"workflows, installation paths, and docs that help you go from first install to daily use quickly."
),
content,
count=1,
)
content = re.sub(
r"^\*\*Antigravity Awesome Skills\*\* is a curated, battle-tested library of \*\*.*?\*\* designed",
(