Skip to content

Commit 22fa3a2

Browse files
committed
feat: add assignees column
1 parent b86897d commit 22fa3a2

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/add-issues.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const readCSV = (filePath) => {
1313
fs.createReadStream(filePath)
1414
.pipe(csvParser())
1515
.on('data', (row) => {
16-
issueList.push({ title: row.title, body: row.body });
16+
issueList.push({ title: row.title, body: row.body, assignees: row.assignees });
1717
})
1818
.on('end', () => {
1919
resolve(issueList);
@@ -32,6 +32,7 @@ const createIssues = async (issues, octokit, repo) => {
3232
repo,
3333
title: issue.title,
3434
body: issue.body,
35+
assignees: issue.assignees.split(',').map((assignee) => assignee.trim()),
3536
});
3637
console.log(`Issue created: ${issue.title}`);
3738
} catch (error) {

src/data/sample-1.csv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
title,body
2-
Sample (1) Issue 1,This is the body of the first sample issue.
3-
Sample (1) Issue 2,This is the body of the second sample issue.
1+
title,body,assignees
2+
Sample (1) Issue 1,This is the body of the first sample issue.,
3+
Sample (1) Issue 2,This is the body of the second sample issue.,

src/data/sample-2.csv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
title,body
2-
Sample (2) Issue 1,This is the body of the first sample issue.
3-
Sample (2) Issue 2,This is the body of the second sample issue.
1+
title,body,assignees
2+
Sample (2) Issue 1,This is the body of the first sample issue.,
3+
Sample (2) Issue 2,This is the body of the second sample issue.,

0 commit comments

Comments
 (0)