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

Commit

Permalink
Add option bot_icon (#461)
Browse files Browse the repository at this point in the history
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 -->
  • Loading branch information
riya-amemiya authored Sep 15, 2023
1 parent 91180ab commit 44244a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: '<img src="https://avatars.githubusercontent.com/in/347564?s=41" alt="Image description" width="20" height="20">'
runs:
using: 'node16'
main: 'dist/index.js'
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/commenter.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -7,7 +7,7 @@ import {octokit} from './octokit'
const context = github_context
const repo = context.repo

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

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

0 comments on commit 44244a9

Please sign in to comment.