diff --git a/import.js b/import.js index b0c12b2..6de8dc2 100644 --- a/import.js +++ b/import.js @@ -41,8 +41,14 @@ const importFile = (octokit, file, values) => { sendObj.issue.title = row[titleIndex]; // if we have a body column, pass that. - if (bodyIndex > -1 && row[bodyIndex] !== "") { - sendObj.issue.body = row[bodyIndex]; + if (bodyIndex > -1) { + if (row[bodyIndex] !== "") { + sendObj.issue.body = row[bodyIndex]; + } + else { + // if the body is not defined, copy the title to the body of the issue + sendObj.issue.body = row[titleIndex]; + } } // if we have a labels column, pass that. diff --git a/test/emptyBodyLines.csv b/test/emptyBodyLines.csv new file mode 100644 index 0000000..b480fdf --- /dev/null +++ b/test/emptyBodyLines.csv @@ -0,0 +1,3 @@ +title, body,labels +Test 1, , bug +Test 2, This is the test2 desc, question