Skip to content

Commit

Permalink
fix: Fix indentation of master branch prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcbachmann committed May 24, 2024
1 parent 1e7ae75 commit 0db9b43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backport.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ async function requestReviewers (context, prId, reviewers) {

function patchPullRequestBody (pr) {
const body = pr.body || ''
const indent = /Relations:\n( *)-/.exec(body)?.[1].length || 0
const msg = `Relations:\n${' '.repeat(indent)}- Master: #${pr.number}`
const indent = /Relations:\r?\n( *)-/.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}`
}

0 comments on commit 0db9b43

Please sign in to comment.