From 82799270d530a95d9e56ca788d4a4f132540c8ef Mon Sep 17 00:00:00 2001 From: Yuta Nishi Date: Thu, 14 Sep 2023 14:40:56 +0900 Subject: [PATCH 1/3] add option bot_icon --- action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/action.yml b/action.yml index c2fc4d76..8c96b0ba 100644 --- a/action.yml +++ b/action.yml @@ -234,6 +234,10 @@ inputs: required: false description: ISO code for the response language default: en-US + bot_icon: + required: false + description: 'The icon for the bot' + default: 'Image description' runs: using: 'node16' main: 'dist/index.js' From 15b7264d6cb6373715c31aa3791ee4a0cd4aa2d9 Mon Sep 17 00:00:00 2001 From: Yuta Nishi Date: Thu, 14 Sep 2023 14:42:09 +0900 Subject: [PATCH 2/3] refactor(src/commenter.ts): use getInput() to get bot_icon value --- src/commenter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commenter.ts b/src/commenter.ts index 463e92cf..fc14e70f 100644 --- a/src/commenter.ts +++ b/src/commenter.ts @@ -1,4 +1,4 @@ -import {info, warning} from '@actions/core' +import {getInput, info, warning} from '@actions/core' // eslint-disable-next-line camelcase import {context as github_context} from '@actions/github' import {octokit} from './octokit' @@ -7,7 +7,7 @@ import {octokit} from './octokit' const context = github_context const repo = context.repo -export const COMMENT_GREETING = `Image description CodeRabbit` +export const COMMENT_GREETING = `${getInput('bot_icon')} CodeRabbit` export const COMMENT_TAG = '' From d9fbbd80c2158ee7cae1c00fbd47a9793dc83c8b Mon Sep 17 00:00:00 2001 From: Yuta Nishi Date: Thu, 14 Sep 2023 14:42:26 +0900 Subject: [PATCH 3/3] build --- dist/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index a6f80920..a6f49664 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3911,7 +3911,7 @@ IMPORTANT: Entire response must be in the language with ISO code: ${options.lang // eslint-disable-next-line camelcase const context = _actions_github__WEBPACK_IMPORTED_MODULE_1__.context; const repo = context.repo; -const COMMENT_GREETING = `Image description CodeRabbit`; +const COMMENT_GREETING = `${(0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput)('bot_icon')} CodeRabbit`; const COMMENT_TAG = ''; const COMMENT_REPLY_TAG = ''; const SUMMARIZE_TAG = '';