diff --git a/README.md b/README.md index 2971149..6c516c2 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/main.sh b/main.sh index ed8e217..5c98992 100644 --- a/main.sh +++ b/main.sh @@ -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"