Skip to content

Commit

Permalink
Fix "null" being appended to the body in case the original PR didn't …
Browse files Browse the repository at this point in the history
…have a body (#21)

So go-gitea/gitea#23852 won't happen again

Closes #20
  • Loading branch information
yardenshoham committed Mar 31, 2023
1 parent ec694ba commit f25c254
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ export const createBackportPr = async (
},
giteaVersion: GiteaVersion,
) => {
let prDescription =
`Backport #${originalPr.number} by @${originalPr.user.login}`;
if (originalPr.body) {
prDescription += "\n\n" + originalPr.body;
}
let response = await fetch(`${GITHUB_API}/repos/go-gitea/gitea/pulls`, {
method: "POST",
headers: HEADERS,
Expand All @@ -82,8 +87,7 @@ export const createBackportPr = async (
)
}`,
base: `release/v${giteaVersion.majorMinorVersion}`,
body:
`Backport #${originalPr.number} by @${originalPr.user.login}\n\n${originalPr.body}`,
body: prDescription,
maintainer_can_modify: true,
}),
});
Expand Down

0 comments on commit f25c254

Please sign in to comment.