From bff374700c274172b2861415f6d561779e7a3d42 Mon Sep 17 00:00:00 2001 From: 839 <8398a7@gmail.com> Date: Sun, 5 Apr 2020 16:59:40 +0900 Subject: [PATCH] [#3] [command] npm run release --- dist/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 9c234e06..beb0aa78 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10458,8 +10458,7 @@ class Client { const template = yield this.payloadTemplate(); template.attachments[0].color = 'good'; template.text += this.mentionText(this.with.mention, exports.Success); - template.text += ':white_check_mark: Succeeded GitHub Actions\n'; - template.text += text; + template.text += this.insertText(':white_check_mark: Succeeded GitHub Actions\n', text); return template; }); } @@ -10468,8 +10467,7 @@ class Client { const template = yield this.payloadTemplate(); template.attachments[0].color = 'danger'; template.text += this.mentionText(this.with.mention, exports.Failure); - template.text += ':no_entry: Failed GitHub Actions\n'; - template.text += text; + template.text += this.insertText(':no_entry: Failed GitHub Actions\n', text); return template; }); } @@ -10478,8 +10476,7 @@ class Client { const template = yield this.payloadTemplate(); template.attachments[0].color = 'warning'; template.text += this.mentionText(this.with.mention, exports.Cancelled); - template.text += ':warning: Canceled GitHub Actions\n'; - template.text += text; + template.text += this.insertText(':warning: Canceled GitHub Actions\n', text); return template; }); } @@ -10606,6 +10603,9 @@ class Client { filterField(array, diff) { return array.filter(item => item !== diff); } + insertText(defaultText, text) { + return text === '' ? defaultText : text; + } } exports.Client = Client;