Skip to content

Commit

Permalink
Add env variable for custom GitHub Actor
Browse files Browse the repository at this point in the history
Signed-off-by: Riddhesh Sanghvi <[email protected]>
  • Loading branch information
mrrobot47 committed Nov 13, 2020
1 parent e9db0ef commit 899990c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ By default, action is designed to run with minimal configuration but you can alt
Variable | Default | Purpose
------------------|-------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------
SLACK_CHANNEL | Set during Slack webhook creation | Specify Slack channel in which message needs to be sent
SLACK_USERNAME | `rtBot` | The name of the sender of the message. Does not need to be a "real" username
SLACK_USERNAME | `rtBot` | Custom Slack Username sending the message. Does not need to be a "real" username.
SLACK_MSG_AUTHOR | `$GITHUB_ACTOR` (The person who triggered action). | GitHub username of the person who has triggered the action. In case you want to modify it, please specify corrent GitHub username.
SLACK_ICON | ![rtBot Avatar](https://github.com/rtBot.png?size=32) | User/Bot icon shown with Slack message. It uses the URL supplied to this env variable to display the icon in slack message.
SLACK_ICON_EMOJI | - | User/Bot icon shown with Slack message, in case you do not wish to add a URL for slack icon as above, you can set slack emoji in this env variable. Example value: `:bell:` or any other valid slack emoji.
SLACK_COLOR | `good` (green) | You can pass an RGB value like `#efefef` which would change color on left side vertical line of Slack message.
Expand Down
1 change: 1 addition & 0 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export SLACK_USERNAME=${SLACK_USERNAME:-"rtBot"}
export CI_SCRIPT_OPTIONS="ci_script_options"
export SLACK_TITLE=${SLACK_TITLE:-"Message"}
export COMMIT_MESSAGE=$(cat "$GITHUB_EVENT_PATH" | jq -r '.commits[-1].message')
export GITHUB_ACTOR=${SLACK_MSG_AUTHOR:-"$GITHUB_ACTOR"}

hosts_file="$GITHUB_WORKSPACE/.github/hosts.yml"

Expand Down

0 comments on commit 899990c

Please sign in to comment.