Skip to content

Commit 57470a3

Browse files
feat(release): also bump README version badge
1 parent 3fd71db commit 57470a3

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

.releaserc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
{
1717
"assets": [
1818
"CHANGELOG.md",
19+
"README.md",
1920
"package.json",
2021
".claude-plugin/marketplace.json",
2122
"plugins/honcho/.claude-plugin/plugin.json",

scripts/bump-versions.mjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,17 @@ for (const t of targets) {
3838
writeFileSync(p, JSON.stringify(json, null, 2) + "\n");
3939
console.log(`bumped ${t.path} -> ${version}`);
4040
}
41+
42+
// README version badge — shields.io URL-encodes the dash in `1.0.1-oc` to `--`
43+
const badgeVersion = version.replace(/-/g, "--");
44+
const readmePath = join(root, "README.md");
45+
const readme = readFileSync(readmePath, "utf8");
46+
const updated = readme.replace(
47+
/(\[!\[Version\]\(https:\/\/img\.shields\.io\/badge\/version-).+?(-blue\))/,
48+
`$1${badgeVersion}$2`,
49+
);
50+
if (updated !== readme) {
51+
writeFileSync(readmePath, updated);
52+
console.log(`bumped README.md badge -> ${version}`);
53+
}
54+

0 commit comments

Comments
 (0)