mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-15 11:56:01 +00:00
fix(release): let alpha tags publish from their exact changelog heading
Shipped alpha tags carry a dedicated ## X-alpha.N heading with no base section (see v2026.6.20-alpha.1's tagged CHANGELOG.md); the renderer and candidate provenance now prefer that dedicated heading for alpha and correction tags while beta/stable remain pinned to the stable base section per #103222.
This commit is contained in:
@@ -230,24 +230,25 @@ function compactReleaseNotes(section, repository, tag) {
|
||||
].join("\n");
|
||||
}
|
||||
|
||||
export function correctionVersionForTag(tag) {
|
||||
// Numeric-correction tags (vX-N) may carry their own changelog heading;
|
||||
// alpha/beta prerelease tags never do.
|
||||
export function dedicatedSectionVersionForTag(tag) {
|
||||
// Correction (vX-N) and alpha tags may carry their own exact changelog
|
||||
// heading; beta and stable bodies must come from the stable base section.
|
||||
const taggedVersion = tag.replace(/^v/u, "");
|
||||
const isCorrection =
|
||||
/-[1-9][0-9]*$/u.test(taggedVersion) && !/-(?:alpha|beta)\.[1-9][0-9]*$/u.test(taggedVersion);
|
||||
return isCorrection ? taggedVersion : undefined;
|
||||
if (/-beta\.[1-9][0-9]*$/u.test(taggedVersion)) {
|
||||
return undefined;
|
||||
}
|
||||
return /-(?:alpha\.)?[1-9][0-9]*$/u.test(taggedVersion) ? taggedVersion : undefined;
|
||||
}
|
||||
|
||||
export function releaseNotesSectionForTag(changelog, version, tag) {
|
||||
// Correction tags prefer their own exact heading when the changelog carries
|
||||
// one; otherwise they fall back to the base version.
|
||||
const correctionVersion = correctionVersionForTag(tag);
|
||||
if (correctionVersion && correctionVersion !== version) {
|
||||
// Alpha and correction tags prefer their own exact heading when the
|
||||
// changelog carries one; otherwise they fall back to the base version.
|
||||
const dedicatedVersion = dedicatedSectionVersionForTag(tag);
|
||||
if (dedicatedVersion && dedicatedVersion !== version) {
|
||||
try {
|
||||
return extractChangelogSection(changelog, correctionVersion);
|
||||
return extractChangelogSection(changelog, dedicatedVersion);
|
||||
} catch {
|
||||
// The correction has no dedicated section; use the base version below.
|
||||
// No dedicated section; use the base version below.
|
||||
}
|
||||
}
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user