From b1cc20d891ec43a000e5b31caa18918e8d4ef189 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Tue, 5 Feb 2019 06:41:51 +0100
Subject: [PATCH] =?UTF-8?q?refactor(github):=20don=E2=80=99t=20warn=20if?=
 =?UTF-8?q?=20failing=20to=20comment=20on=20locked=20issue?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/platform/github/index.js | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/lib/platform/github/index.js b/lib/platform/github/index.js
index 0c32a62c13..af1d74cf44 100644
--- a/lib/platform/github/index.js
+++ b/lib/platform/github/index.js
@@ -849,7 +849,13 @@ async function ensureComment(issueNo, topic, content) {
     }
     return true;
   } catch (err) /* istanbul ignore next */ {
-    logger.warn({ err }, 'Error ensuring comment');
+    if (
+      err.message === 'Unable to create comment because issue is locked. (403)'
+    ) {
+      logger.info('Issue is locked - cannot add comment');
+    } else {
+      logger.warn({ err }, 'Error ensuring comment');
+    }
     return false;
   }
 }
@@ -868,7 +874,13 @@ async function ensureCommentRemoval(issueNo, topic) {
       await deleteComment(commentId);
     }
   } catch (err) /* istanbul ignore next */ {
-    logger.warn({ err }, 'Error ensuring comment removal');
+    if (
+      err.message === 'Unable to create comment because issue is locked. (403)'
+    ) {
+      logger.info('Issue is locked - cannot add comment');
+    } else {
+      logger.warn({ err }, 'Error ensuring comment removal');
+    }
   }
 }
 
-- 
GitLab