diff --git a/scripts/check-release-consistency.mjs b/scripts/check-release-consistency.mjs index 45c4f844..ed9a8fe9 100644 --- a/scripts/check-release-consistency.mjs +++ b/scripts/check-release-consistency.mjs @@ -188,6 +188,12 @@ function requireText(text, expected, path, errors) { if (!text.includes(expected)) errors.push(`${path} is missing ${JSON.stringify(expected)}`); } +function requireAnyText(text, expectedValues, path, errors) { + if (!expectedValues.some((expected) => text.includes(expected))) { + errors.push(`${path} is missing one of ${expectedValues.map(JSON.stringify).join(", ")}`); + } +} + function extractWorkflowJob(source, jobName, errors) { const lines = source.split(/\r?\n/u); const header = ` ${jobName}:`; @@ -1149,9 +1155,12 @@ export function collectReleaseConsistencyErrors(files, releaseTag) { ".github/workflows/release.yml", errors, ); - requireText( + requireAnyText( releaseWorkflow, - "body_path: .release-source/docs/CURRENT_RELEASE_NOTES.md", + [ + "body_path: docs/CURRENT_RELEASE_NOTES.md", + "body_path: .release-source/docs/CURRENT_RELEASE_NOTES.md", + ], ".github/workflows/release.yml", errors, ); diff --git a/scripts/check-release-consistency.test.mjs b/scripts/check-release-consistency.test.mjs index c8469adf..d574d048 100644 --- a/scripts/check-release-consistency.test.mjs +++ b/scripts/check-release-consistency.test.mjs @@ -485,6 +485,17 @@ test("historical repair keeps trusted publication control separate from release assert.match(verifyStep.run, /^node scripts\/reconcile-release-assets\.mjs/u); }); +test("historical release content may retain its root-relative release notes path", () => { + const historical = changed(".github/workflows/release.yml", (workflow) => + workflow.replace( + "body_path: .release-source/docs/CURRENT_RELEASE_NOTES.md", + "body_path: docs/CURRENT_RELEASE_NOTES.md", + ), + ); + + assert.deepEqual(collectReleaseConsistencyErrors(historical), []); +}); + test("rejects published app-wire version drift until release surfaces agree", () => { const drifted = changedRuntime("publishedAppWire", (record) => { record.version = "0.5.1";