From 450b16d594b116f36a599e4d7008971fd64d3508 Mon Sep 17 00:00:00 2001 From: dessant Date: Fri, 1 Oct 2021 23:36:18 +0300 Subject: [PATCH] fix: ignore error when commenting on issue converted to discussion --- src/index.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index a4ccb1b..579710e 100644 --- a/src/index.js +++ b/src/index.js @@ -98,10 +98,16 @@ class App { body: commentBody }); } else { - await this.client.rest.issues.createComment({ - ...issue, - body: commentBody - }); + try { + await this.client.rest.issues.createComment({ + ...issue, + body: commentBody + }); + } catch (err) { + if (!/cannot be modified.*discussion/i.test(err.message)) { + throw err; + } + } } } });