diff --git a/.vscode/launch.json b/.vscode/launch.json index 4f3afe0..c03c46f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -21,6 +21,22 @@ "skipFiles": [ "/**" ], + "cwd": "/home/james/src/harth/sum-type", + "args": ["pr"], + "program": "${workspaceFolder}/bin.js" + }, + { + "type": "pwa-node", + "request": "launch", + "name": "sum-type:pr", + "skipFiles": [ + "/**" + ], + "cwd": "/home/james/src/harth/sum-type", + "env": { + "GITHUB_REPOSITORY":"JAForbes/sum-type" + }, + "envFile": "${workspaceFolder}/.env", "args": ["pr"], "program": "${workspaceFolder}/bin.js" }, @@ -74,6 +90,20 @@ "args": ["merge", "--commit", "--target", "main", "--source", "next", "--verbose", "--force", "--clean", "--changelog", "--compact"], "program": "${workspaceFolder}/bin.js" }, + { + "type": "pwa-node", + "request": "launch", + "name": "sum-type:merge --commit", + "skipFiles": [ + "/**" + ], + "env": { + "GITHUB_REPOSITORY":"JAForbes/sum-type" + }, + "envFile": "${workspaceFolder}/.env", + "args": ["merge", "--commit", "--target", "main", "--source", "next", "--verbose", "--force", "--clean", "--changelog", "--compact"], + "program": "${workspaceFolder}/bin.js" + }, { "type": "pwa-node", "request": "launch", diff --git a/lib/index.js b/lib/index.js index 43cc1cb..4c779ad 100644 --- a/lib/index.js +++ b/lib/index.js @@ -309,8 +309,9 @@ async function extractChangelog(options){ let recentBranches; { let firstEverRelease = a == null; + let onlyOneRelease = b == null - let q = firstEverRelease + let q = firstEverRelease || onlyOneRelease ? `base:${source} is:pr is:merged repo:${owner}/${repo}` : `merged:${a.closed_at}..${b.closed_at} base:${source} is:pr is:merged repo:${owner}/${repo}`