Skip to content

Commit 5532d8e

Browse files
authored
Merge pull request #4218 from github/mario-campos/loosen-changenote-validation
Do not validate change-note file names or frontmatter
2 parents 68f5b57 + 45cda5b commit 5532d8e

2 files changed

Lines changed: 1 addition & 36 deletions

File tree

‎pr-checks/changelog/validate.test.ts‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -154,26 +154,6 @@ await describe("isValidChangenoteFile", async () => {
154154
assert.equal(isValidChangenoteFile("non-existent-file.md"), false);
155155
});
156156

157-
await it("rejects invalid filename", async () => {
158-
await withTmpFile(
159-
"fix-bug.md",
160-
"---\ncategory: fix\n---\n- Fixed a bug\n",
161-
(filePath) => {
162-
assert.equal(isValidChangenoteFile(filePath), false);
163-
},
164-
);
165-
});
166-
167-
await it("rejects missing frontmatter", async () => {
168-
await withTmpFile(
169-
"2026-01-01-fix-bug.md",
170-
"- Fixed a bug\n",
171-
(filePath) => {
172-
assert.equal(isValidChangenoteFile(filePath), false);
173-
},
174-
);
175-
});
176-
177157
await it("rejects invalid Markdown", async () => {
178158
await withTmpFile(
179159
"2026-01-01-fix-bug.md",

‎pr-checks/changelog/validate.ts‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as fs from "node:fs";
2-
import * as path from "node:path";
32

43
import { matter } from "lite-matter";
54
import type { List, ListItem } from "mdast";
@@ -95,21 +94,7 @@ export function isValidChangenoteFile(filename: string): boolean {
9594
return false;
9695
}
9796

98-
const { data: frontmatter, content } = matter(fileData);
99-
100-
if (!isValidChangenoteFilename(path.basename(filename))) {
101-
isValid = false;
102-
console.error(
103-
`${filename}: invalid filename; must match pattern YYYY-MM-DD-id.md`,
104-
);
105-
}
106-
if (!hasValidChangenoteCategory(frontmatter)) {
107-
isValid = false;
108-
const categories = Object.keys(VALID_CHANGE_NOTE_CATEGORIES).join(", ");
109-
console.error(
110-
`${filename}: invalid category; must be one of: ${categories}`,
111-
);
112-
}
97+
const { content } = matter(fileData);
11398
if (!isValidChangenoteContent(content)) {
11499
isValid = false;
115100
console.error(

0 commit comments

Comments
 (0)