From 0a23571b58c7e6411f97d484f1af9295c28ed236 Mon Sep 17 00:00:00 2001 From: Marc Bachmann Date: Wed, 29 May 2024 18:19:29 +0200 Subject: [PATCH] fix: Detect spaces better when using a relations block with multiple newlines until the next line --- backport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backport.js b/backport.js index f61e813..6bf7606 100644 --- a/backport.js +++ b/backport.js @@ -68,7 +68,7 @@ async function requestReviewers (context, prId, reviewers) { function patchPullRequestBody (pr) { const body = pr.body || '' - const indent = /Relations:\r?\n( *)-/.exec(body)?.[1].length || 0 + const indent = /Relations:\s+?( *)-/.exec(body)?.[1].length || 0 const msg = `Relations:\r\n${' '.repeat(indent)}- Master: #${pr.number}` if (body.includes('Relations:')) return body.replace('Relations:', msg) return `${msg}\n${body}`