Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

Commit 44244a9

Browse files
authored
Add option bot_icon (#461)
Modify the icon and image dimensions to be customizable, since the icons displayed in Coderabbit's Slack notifications are excessively large and clutter the screen. <!-- This is an auto-generated comment: release notes by OSS CodeRabbit --> ### Summary by CodeRabbit - New Feature: Added a new optional input parameter `bot_icon` to the GitHub Action workflow. This allows users to customize the icon displayed in Slack notifications sent by the bot. The default value remains as the pre-defined image tag, ensuring backward compatibility for existing users who do not specify this new parameter. <!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
1 parent 91180ab commit 44244a9

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

action.yml

+4
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ inputs:
234234
required: false
235235
description: ISO code for the response language
236236
default: en-US
237+
bot_icon:
238+
required: false
239+
description: 'The icon for the bot'
240+
default: '<img src="https://avatars.githubusercontent.com/in/347564?s=41" alt="Image description" width="20" height="20">'
237241
runs:
238242
using: 'node16'
239243
main: 'dist/index.js'

dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/commenter.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {info, warning} from '@actions/core'
1+
import {getInput, info, warning} from '@actions/core'
22
// eslint-disable-next-line camelcase
33
import {context as github_context} from '@actions/github'
44
import {octokit} from './octokit'
@@ -7,7 +7,7 @@ import {octokit} from './octokit'
77
const context = github_context
88
const repo = context.repo
99

10-
export const COMMENT_GREETING = `<img src="https://avatars.githubusercontent.com/in/347564?s=41" alt="Image description" width="20" height="20"> CodeRabbit`
10+
export const COMMENT_GREETING = `${getInput('bot_icon')} CodeRabbit`
1111

1212
export const COMMENT_TAG =
1313
'<!-- This is an auto-generated comment by OSS CodeRabbit -->'

0 commit comments

Comments
 (0)