1import { danger, warn } from "danger";
2
3const RELEASE_NOTES_PATTERN = new RegExp("Release Notes:\\r?\\n\\s+-", "gm");
4
5const hasReleaseNotes = RELEASE_NOTES_PATTERN.test(danger.github.pr.body);
6if (!hasReleaseNotes) {
7 warn(
8 [
9 "This PR is missing release notes.",
10 "",
11 'Please add a "Release Notes" section that describes the change:',
12 "",
13 "```",
14 "Release Notes:",
15 "",
16 "- (Added|Fixed|Improved) ... ([#<public_issue_number_if_exists>](https://github.com/zed-industries/zed/issues/<public_issue_number_if_exists>)).",
17 "```",
18 "",
19 'If your change is not user-facing, you can use "N/A" for the entry:',
20 "```",
21 "Release Notes:",
22 "",
23 "- N/A",
24 "```",
25 ].join("\n"),
26 );
27}