Skip to content

Commit d1e48e4

Browse files
committed
Detect when MR has a description that is too long
1 parent 7cae049 commit d1e48e4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/githubHelper.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,10 @@ export class GithubHelper {
566566
issue: IssueImport,
567567
comments: CommentImport[]
568568
): Promise<number | null> {
569+
// see: https://github.com/orgs/community/discussions/27190
570+
if (issue.body.length > 65536) {
571+
throw `${issue.title} has a body longer than 65536 characters. Please shorten it.`;
572+
}
569573
// create the GitHub issue from the GitLab issue
570574
let pending = await this.githubApi.request(
571575
`POST /repos/${settings.github.owner}/${settings.github.repo}/import/issues`,

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,8 @@ async function transferMergeRequests() {
589589
'Could not create pull request: !' + mr.iid + ' - ' + mr.title
590590
);
591591
console.error(err);
592+
// Stop execution to be able to correct issue
593+
process.exit(1);
592594
}
593595
} else {
594596
if (githubRequest) {

0 commit comments

Comments
 (0)