From 60d2a1a4bee140c0408a057fdb025155cdba18dd Mon Sep 17 00:00:00 2001 From: dessant Date: Tue, 17 Aug 2021 10:53:26 +0300 Subject: [PATCH] fix: ignore error when commenting on issue converted to discussion Closes #24. --- src/index.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index f1a8674..7fa48f6 100644 --- a/src/index.js +++ b/src/index.js @@ -46,10 +46,16 @@ class App { if (lockComment) { core.debug(`Commenting (${type}: ${issue.issue_number})`); - await this.client.rest.issues.createComment({ - ...issue, - body: lockComment - }); + try { + await this.client.rest.issues.createComment({ + ...issue, + body: lockComment + }); + } catch (err) { + if (!/cannot be modified.*discussion/i.test(err.message)) { + throw err; + } + } } if (lockLabels) {