mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-05-10 18:53:43 +00:00
fix: preserve new lines in body and comments (#72)
This commit is contained in:
parent
a402fa4525
commit
fa43ffc1dc
7 changed files with 44 additions and 38 deletions
7
dist/cli/index.js
vendored
7
dist/cli/index.js
vendored
|
@ -340,7 +340,7 @@ class PullRequestConfigsParser extends configs_parser_1.default {
|
|||
}
|
||||
}
|
||||
const bodyPrefix = args.bodyPrefix ?? `**Backport:** ${originalPullRequest.htmlUrl}\r\n\r\n`;
|
||||
const body = args.body ?? `${originalPullRequest.body}`;
|
||||
const body = bodyPrefix + (args.body ?? `${originalPullRequest.body}`);
|
||||
const labels = args.labels ?? [];
|
||||
if (args.inheritLabels) {
|
||||
labels.push(...originalPullRequest.labels);
|
||||
|
@ -361,11 +361,12 @@ class PullRequestConfigsParser extends configs_parser_1.default {
|
|||
head: backportBranch,
|
||||
base: args.targetBranch,
|
||||
title: args.title ?? `[${args.targetBranch}] ${originalPullRequest.title}`,
|
||||
body: `${bodyPrefix}${body}`,
|
||||
// preserve new line chars
|
||||
body: body.replace(/\\n/g, "\n").replace(/\\r/g, "\r"),
|
||||
reviewers: [...new Set(reviewers)],
|
||||
assignees: [...new Set(args.assignees)],
|
||||
labels: [...new Set(labels)],
|
||||
comments: args.comments ?? [],
|
||||
comments: args.comments?.map(c => c.replace(/\\n/g, "\n").replace(/\\r/g, "\r")) ?? [],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue