diff --git a/.vscode/launch.json b/.vscode/launch.json index 08721046..432b344b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,15 +9,7 @@ "type": "node", "request": "launch", "runtimeArgs": ["-r", "ts-node/register"], - "args": [ - "${workspaceFolder}/src/debug.ts", - "re", - "-c", - "-u", - "Product", - "--repo", - "service-lumin" - ], + "args": ["${workspaceFolder}/src/debug.ts", "is", "--milestone", "Milestone 5"], // "args": ["${workspaceFolder}/src/debug.ts", "ji", "LWM-117", "--status"], "console": "integratedTerminal" }, diff --git a/README.md b/README.md index b5262680..2af6646a 100644 --- a/README.md +++ b/README.md @@ -785,10 +785,10 @@ gh is --list --state closed gh is --list --date "dddd, MMMM Do YYYY, h:mm:ss a" ``` -- List issues filtered by milestone. +- List issues filtered by milestone title. ``` -gh is --list --milestone 1 +gh is --list --milestone "milestone title" ``` - List issues that contains labels `todo` and `bug`. diff --git a/src/cmds/issue.ts b/src/cmds/issue.ts index 3bdb4bfa..93edc93c 100644 --- a/src/cmds/issue.ts +++ b/src/cmds/issue.ts @@ -294,6 +294,13 @@ async function list(options, user, repo) { .filter(milestone => options.milestone === milestone.title) .map(milestone => milestone.number)[0] + if (!milestoneNumber) { + logger.log( + `No issues found with milestone title: ${logger.colors.red(options.milestone)}` + ) + return + } + payload.milestone = `${milestoneNumber}` }