From 67eb60fb4ff3b94bbcaaeadf54c9d6e5bc3a3839 Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Wed, 10 Jan 2018 07:25:56 +0100 Subject: [PATCH] fix: forking mode should add/edit/delete comments in parent repo --- lib/platform/github/index.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/platform/github/index.js b/lib/platform/github/index.js index 285281cc53..9471952ce2 100644 --- a/lib/platform/github/index.js +++ b/lib/platform/github/index.js @@ -535,21 +535,30 @@ async function getComments(issueNo) { async function addComment(issueNo, body) { // POST /repos/:owner/:repo/issues/:number/comments - await get.post(`repos/${config.repoName}/issues/${issueNo}/comments`, { - body: { body }, - }); + await get.post( + `repos/${config.parentRepo || config.repoName}/issues/${issueNo}/comments`, + { + body: { body }, + } + ); } async function editComment(commentId, body) { // PATCH /repos/:owner/:repo/issues/comments/:id - await get.patch(`repos/${config.repoName}/issues/comments/${commentId}`, { - body: { body }, - }); + await get.patch( + `repos/${config.parentRepo || + config.repoName}/issues/comments/${commentId}`, + { + body: { body }, + } + ); } async function deleteComment(commentId) { // DELETE /repos/:owner/:repo/issues/comments/:id - await get.delete(`repos/${config.repoName}/issues/comments/${commentId}`); + await get.delete( + `repos/${config.parentRepo || config.repoName}/issues/comments/${commentId}` + ); } async function ensureComment(issueNo, topic, content) { -- GitLab