Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
fix(pull-request): only add body when updating PR when body is truthy
Browse files Browse the repository at this point in the history
Resolves bug report #678:
Error: Error closing PR
Error: Can't close pull request 1319.
HttpError: 'body' cannot be null
    at main (/usr/lib/node_modules/gh/lib/cmds/pull-request.js:164:23)
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
Ryan Garant committed Oct 2, 2019
1 parent 441cfd8 commit da8cdbf
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -9,17 +9,7 @@
"type": "node",
"request": "launch",
"runtimeArgs": ["-r", "ts-node/register"],
"args": [
"${workspaceFolder}/src/debug.ts",
"is",
"--new",
"--title",
"Add Ramda as a npm dependency to being refactoring towards functional style",
"--message",
"Ramda is the top functional programming lib for JS",
"--repo",
"node-gh"
],
"args": ["${workspaceFolder}/src/debug.ts", "pr", "109", "-C"],
// "args": ["${workspaceFolder}/src/debug.ts", "ji", "LWM-117", "--status"],
"console": "integratedTerminal"
},
2 changes: 1 addition & 1 deletion src/cmds/pull-request.ts
Original file line number Diff line number Diff line change
@@ -858,10 +858,10 @@ function updatePullRequest_(options, title, opt_body, state) {
const payload = {
state,
title,
body: opt_body,
pull_number: options.number,
repo: options.repo,
owner: options.user,
...(opt_body ? { body: opt_body } : {}),
}

return options.GitHub.pulls.update(payload)

0 comments on commit da8cdbf

Please sign in to comment.