Skip to content
Snippets Groups Projects
Commit b3d8b14e authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix(pr): ignore white space and headings when comparing PR bodies

parent b74a491b
No related branches found
No related tags found
No related merge requests found
......@@ -15,8 +15,8 @@ import { getPrBody } from './body';
import { ChangeLogError } from './changelog';
import { codeOwnersForPr } from './code-owners';
function noWhitespace(input: string): string {
return input.replace(/\r?\n|\r|\s/g, '');
function noWhitespaceOrHeadings(input: string): string {
return input.replace(/\r?\n|\r|\s|#/g, '');
}
function noLeadingAtSymbol(input: string): string {
......@@ -293,7 +293,8 @@ export async function ensurePr(
existingPrBody = existingPrBody.trim();
if (
existingPr.title === prTitle &&
noWhitespace(existingPrBody) === noWhitespace(prBody)
noWhitespaceOrHeadings(existingPrBody) ===
noWhitespaceOrHeadings(prBody)
) {
logger.debug(`${existingPr.displayNumber} does not need updating`);
return { prResult: PrResult.NotUpdated, pr: existingPr };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment