Skip to content

Commit

Permalink
Resolve conflict
Browse files Browse the repository at this point in the history
Signed-off-by: Riddhesh Sanghvi <[email protected]>
  • Loading branch information
mrrobot47 committed Jun 4, 2021
2 parents 6e55bf2 + 4c41b90 commit 2874bcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ SLACK_MSG_AUTHOR | `$GITHUB_ACTOR` (The person who triggered action). | GitH
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 `${{ job.status }}` for automatic coloring or an RGB value like `#efefef` which would change color on left side vertical line of Slack message.
SLACK_LINK_NAMES | - | If set to `true`, enable mention in Slack message.
SLACK_MESSAGE | Generated from git commit message. | The main Slack message in attachment. It is advised not to override this.
SLACK_TITLE | Message | Title to use before main Slack message.
SLACK_FOOTER | Powered By rtCamp's GitHub Actions Library | Slack message footer.
Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
EnvSiteName = "SITE_NAME"
EnvHostName = "HOST_NAME"
EnvMinimal = "MSG_MINIMAL"
EnvSlackLinkNames = "SLACK_LINK_NAMES"
)

type Webhook struct {
Expand All @@ -31,6 +32,7 @@ type Webhook struct {
IconURL string `json:"icon_url,omitempty"`
IconEmoji string `json:"icon_emoji,omitempty"`
Channel string `json:"channel,omitempty"`
LinkNames string `json:"link_names,omitempty"`
UnfurlLinks bool `json:"unfurl_links"`
Attachments []Attachment `json:"attachments,omitempty"`
}
Expand Down Expand Up @@ -195,6 +197,7 @@ func main() {
IconURL: os.Getenv(EnvSlackIcon),
IconEmoji: os.Getenv(EnvSlackIconEmoji),
Channel: os.Getenv(EnvSlackChannel),
LinkNames: os.Getenv(EnvSlackLinkNames),
Attachments: []Attachment{
{
Fallback: envOr(EnvSlackMessage, "GITHUB_ACTION="+os.Getenv("GITHUB_ACTION")+" \n GITHUB_ACTOR="+os.Getenv("GITHUB_ACTOR")+" \n GITHUB_EVENT_NAME="+os.Getenv("GITHUB_EVENT_NAME")+" \n GITHUB_REF="+os.Getenv("GITHUB_REF")+" \n GITHUB_REPOSITORY="+os.Getenv("GITHUB_REPOSITORY")+" \n GITHUB_WORKFLOW="+os.Getenv("GITHUB_WORKFLOW")),
Expand Down

0 comments on commit 2874bcf

Please sign in to comment.