Use Changelog instead of Release Notes for danger bot (#22395)

Summary:
In #22117 we changed the PR template to use `Changelog` instead of `Release notes` and now danger bot is complaining as it wasn't updated there.

cc turnrye
Pull Request resolved: https://github.com/facebook/react-native/pull/22395

Differential Revision: D13195006

Pulled By: TheSavior

fbshipit-source-id: 36b9675c1e30c86fb8d002b121cc29239d6f78dd
This commit is contained in:
Radek Czemerys 2018-11-27 12:36:16 -08:00 committed by Facebook Github Bot
parent 00681c3660
commit 706888df35
1 changed files with 10 additions and 12 deletions

View File

@ -39,21 +39,19 @@ if (!includesTestPlan) {
}
// Regex looks for given categories, types, a file/framework/component, and a message - broken into 4 capture groups
const releaseNotesRegex = /\[\s?(ANDROID|GENERAL|IOS)\s?\]\s*?\[\s?(ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY)\s?\]\s*?\-\s*?(.*)/gi;
const includesReleaseNotes =
const changelogRegex = /\[\s?(ANDROID|GENERAL|IOS)\s?\]\s*?\[\s?(ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY)\s?\]\s*?\-\s*?(.*)/gi;
const includesChangelog =
danger.github.pr.body &&
danger.github.pr.body.toLowerCase().includes('release notes');
const correctlyFormattedReleaseNotes = releaseNotesRegex.test(
danger.github.pr.body,
);
danger.github.pr.body.toLowerCase().includes('changelog');
const correctlyFormattedChangelog = changelogRegex.test(danger.github.pr.body);
if (!includesReleaseNotes) {
const title = ':clipboard: Release Notes';
const idea = 'This PR appears to be missing Release Notes.';
if (!includesChangelog) {
const title = ':clipboard: Changelog';
const idea = 'This PR appears to be missing Changelog.';
warn(`${title} - <i>${idea}</i>`);
} else if (!correctlyFormattedReleaseNotes) {
const title = ':clipboard: Release Notes';
const idea = 'This PR may have incorrectly formatted Release Notes.';
} else if (!correctlyFormattedChangelog) {
const title = ':clipboard: Changelog';
const idea = 'This PR may have incorrectly formatted Changelog.';
warn(`${title} - <i>${idea}</i>`);
}