mirror of
https://code.forgejo.org/actions/git-backporting.git
synced 2025-05-17 02:59:13 -04: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
|
@ -63,7 +63,7 @@ export default class PullRequestConfigsParser extends ConfigsParser {
|
|||
}
|
||||
|
||||
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) {
|
||||
|
@ -87,12 +87,13 @@ export default class PullRequestConfigsParser extends ConfigsParser {
|
|||
repo: originalPullRequest.targetRepo.project,
|
||||
head: backportBranch,
|
||||
base: args.targetBranch,
|
||||
title: args.title ?? `[${args.targetBranch}] ${originalPullRequest.title}`,
|
||||
body: `${bodyPrefix}${body}`,
|
||||
title: args.title ?? `[${args.targetBranch}] ${originalPullRequest.title}`,
|
||||
// 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