ci(release): clarify preview boundaries (#11011)

This commit is contained in:
Taesu
2026-08-27 00:34:58 +09:00
committed by GitHub
parent 860dd435c8
commit 99da8a6cac
2 changed files with 18 additions and 7 deletions
@@ -79,20 +79,24 @@ export function wrapReleaseNotesComment(
: []),
`# Release preview: v${version}`,
"",
"---",
"",
bodyStartMarker,
"",
notes,
"",
bodyEndMarker,
"",
"Maintainers may edit the release notes above. Keep the hidden markers intact.",
"---",
"",
...(merged
? [
"This PR is already merged. Re-run the original failed Release workflow after reviewing these notes.",
"> [!IMPORTANT]",
"> **For maintainers:** This PR is already merged. Review and edit the notes above without changing the hidden markers. Re-run the original failed Release workflow when they are ready.",
]
: [
"Any head update returns this PR to Draft. Rerun `/release-notes` after it changes.",
"The release bot marks this PR ready. Merging it approves these release notes.",
"> [!TIP]",
"> **For maintainers:** You can edit the notes above, but keep the hidden markers intact. If the head changes, this PR returns to Draft. Rerun `/release-notes` after any update. Merging this PR approves the preview.",
]),
].join("\n");
}
@@ -20,6 +20,10 @@ describe("wrapReleaseNotesComment", () => {
expect(comment).toContain("<!-- release-body:start -->");
expect(comment).toContain(notes);
expect(comment).toContain("<!-- release-body:end -->");
expect(comment).toContain(
`# Release preview: v${version}\n\n---\n\n<!-- release-body:start -->`,
);
expect(comment).toContain("<!-- release-body:end -->\n\n---\n\n> [!TIP]");
});
it("rejects empty release notes", () => {
@@ -65,14 +69,17 @@ describe("wrapReleaseNotesComment", () => {
expect(comment).toContain("This PR is already merged");
expect(comment).toContain("Re-run the original failed Release workflow");
expect(comment).not.toContain("marks this PR ready");
expect(comment).toContain("> [!IMPORTANT]");
expect(comment).not.toContain("> [!TIP]");
});
it("explains the draft approval lifecycle", () => {
const comment = wrapReleaseNotesComment(version, head, notes);
expect(comment).toContain("Any head update returns this PR to Draft");
expect(comment).toContain("The release bot marks this PR ready");
expect(comment).toContain("> [!TIP]");
expect(comment).toContain("keep the hidden markers intact");
expect(comment).toContain("this PR returns to Draft");
expect(comment).toContain("Merging this PR approves the preview");
});
it("rejects malformed release identity markers", () => {