File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -464,7 +464,7 @@ async function transferIssues() {
464464 for ( let issue of issues ) {
465465 // try to find a GitHub issue that already exists for this GitLab issue
466466 let githubIssue = githubIssues . find (
467- i => i . title . trim ( ) === issue . title . trim ( )
467+ i => i . title . trim ( ) === issue . title . trim ( ) && i . body . includes ( issue . web_url )
468468 ) ;
469469 if ( ! githubIssue ) {
470470 console . log ( `\nMigrating issue #${ issue . iid } ('${ issue . title } ')...` ) ;
@@ -563,14 +563,14 @@ async function transferMergeRequests() {
563563 // Try to find a GitHub pull request that already exists for this GitLab
564564 // merge request
565565 let githubRequest = githubPullRequests . find (
566- i => i . title . trim ( ) === mr . title . trim ( )
566+ i => i . title . trim ( ) === mr . title . trim ( ) && i . body . includes ( mr . web_url )
567567 ) ;
568568 let githubIssue = githubIssues . find (
569569 // allow for issues titled "Original Issue Name - [merged|closed]"
570570 i => {
571571 // regex needs escaping in case merge request title contains special characters
572572 const regex = new RegExp ( escapeRegExp ( mr . title . trim ( ) ) + ' - \\[(merged|closed)\\]' ) ;
573- return regex . test ( i . title . trim ( ) ) ;
573+ return regex . test ( i . title . trim ( ) ) && i . body . includes ( mr . web_url ) ;
574574 }
575575 ) ;
576576 if ( ! githubRequest && ! githubIssue ) {
You can’t perform that action at this time.
0 commit comments