Skip to content

Commit f25c254

Browse files
authored
Fix "null" being appended to the body in case the original PR didn't have a body (#21)
So go-gitea/gitea#23852 won't happen again Closes #20
1 parent ec694ba commit f25c254

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/github.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ export const createBackportPr = async (
7070
},
7171
giteaVersion: GiteaVersion,
7272
) => {
73+
let prDescription =
74+
`Backport #${originalPr.number} by @${originalPr.user.login}`;
75+
if (originalPr.body) {
76+
prDescription += "\n\n" + originalPr.body;
77+
}
7378
let response = await fetch(`${GITHUB_API}/repos/go-gitea/gitea/pulls`, {
7479
method: "POST",
7580
headers: HEADERS,
@@ -82,8 +87,7 @@ export const createBackportPr = async (
8287
)
8388
}`,
8489
base: `release/v${giteaVersion.majorMinorVersion}`,
85-
body:
86-
`Backport #${originalPr.number} by @${originalPr.user.login}\n\n${originalPr.body}`,
90+
body: prDescription,
8791
maintainer_can_modify: true,
8892
}),
8993
});

0 commit comments

Comments
 (0)