@@ -16,6 +16,11 @@ import * as fs from 'fs';
1616
1717import AWS from 'aws-sdk' ;
1818
19+ const CCERROR = '\x1b[31m%s\x1b[0m' ; // red
20+ const CCWARN = '\x1b[33m%s\x1b[0m' ; // yellow
21+ const CCINFO = '\x1b[36m%s\x1b[0m' ; // cyan
22+ const CCSUCCESS = '\x1b[32m%s\x1b[0m' ; // green
23+
1924const counters = {
2025 nrOfPlaceholderIssues : 0 ,
2126 nrOfReplacementIssues : 0 ,
@@ -326,6 +331,7 @@ async function transferMilestones(usePlaceholders: boolean) {
326331 */
327332async function transferLabels ( attachmentLabel = true , useLowerCase = true ) {
328333 inform ( 'Transferring Labels' ) ;
334+ console . warn ( CCWARN , 'NOTE (2022): GitHub descriptions are limited to 100 characters!' ) ;
329335
330336 // Get a list of all labels associated with this project
331337 let labels : SimpleLabel [ ] = await gitlabApi . Labels . all (
@@ -359,6 +365,19 @@ async function transferLabels(attachmentLabel = true, useLowerCase = true) {
359365
360366 if ( ! githubLabels . find ( l => l === label . name ) ) {
361367 console . log ( 'Creating: ' + label . name ) ;
368+
369+ if ( label . description . length > 100 ) {
370+ const trimmedDescription = label . description . slice ( 0 , 100 ) ;
371+ if ( settings . trimOversizedLabelDescriptions ) {
372+ console . warn ( CCWARN , `Description too long (${ label . description . length } ), it was trimmed: \n "${ label . description } "\n\t to\n "${ trimmedDescription } "` ) ;
373+ label . description = trimmedDescription ;
374+ } else {
375+ console . warn ( CCWARN , `Description too long (${ label . description . length } ), it was excluded.` ) ;
376+ console . debug ( ` "${ label . description } "` ) ;
377+ label . description = '' ;
378+ }
379+ }
380+
362381 try {
363382 // process asynchronous code in sequence
364383 await githubHelper . createLabel ( label ) . catch ( x => { } ) ;
0 commit comments