Skip to content

Commit

Permalink
Fix crash when there is only one release (#241) (#242)
Browse files Browse the repository at this point in the history
Co-authored-by: James Forbes <james.a.forbes@gmail.com>
  • Loading branch information
github-actions[bot] and JAForbes authored Jan 9, 2022
1 parent 66ac106 commit b85efdd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@
"skipFiles": [
"<node_internals>/**"
],
"cwd": "/home/james/src/harth/sum-type",
"args": ["pr"],
"program": "${workspaceFolder}/bin.js"
},
{
"type": "pwa-node",
"request": "launch",
"name": "sum-type:pr",
"skipFiles": [
"<node_internals>/**"
],
"cwd": "/home/james/src/harth/sum-type",
"env": {
"GITHUB_REPOSITORY":"JAForbes/sum-type"
},
"envFile": "${workspaceFolder}/.env",
"args": ["pr"],
"program": "${workspaceFolder}/bin.js"
},
Expand Down Expand Up @@ -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": [
"<node_internals>/**"
],
"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",
Expand Down
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`

Expand Down

0 comments on commit b85efdd

Please sign in to comment.