diff --git a/action.yml b/action.yml index 21411ee..685401d 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ name: 'Google Chat Action' -author: 'D Ther Htun' +author: 'D Ther Htun/ Marcel S. Henselin' description: 'Github actions for google chat Room Bot' branding: icon: 'at-sign' @@ -26,13 +26,6 @@ inputs: runs: using: 'docker' - # using: 'composite' -# steps: -# - name: 'Run Google Chat Action' -# shell: bash -# run: | -# docker run --rm -it $(docker build -q .) - #image: 'docker://dther/google-chat-action:v0.8' image: 'Dockerfile' args: diff --git a/main.go b/main.go index d1478f7..d0f6c29 100644 --- a/main.go +++ b/main.go @@ -23,6 +23,7 @@ var message string type templateData struct { CardID string + IconSlug string Title string SubTitle string Author string @@ -50,6 +51,13 @@ func main() { } data.Author = author + icon := githubactions.GetInput("iconslug") + if icon == "" { + githubactions.Infof("[INFO] Missing input 'iconslug', using default") + icon = "git" + } + data.IconSlug = icon + title := githubactions.GetInput("title") if title == "" { githubactions.Infof("[INFO] Missing input 'title', using default") @@ -168,6 +176,11 @@ func card(d templateData) ([]byte, error) { if d.IconUrl == "" { d.IconUrl = "https://github.githubassets.com/images/modules/logos_page/Octocat.png" + d.IconUrl = fmt.Sprintf( + "https://cdn.simpleicons.org/%s/%s", + d.IconSlug, + d.Color, + ) } if d.EventBody == "" { diff --git a/message.tpl b/message.tpl index dc9ca5b..3a50378 100644 --- a/message.tpl +++ b/message.tpl @@ -13,7 +13,7 @@ "sections": [ { "header": "{{ .Title }}", - "collapsible": true, + "collapsible": false, "uncollapsibleWidgetsCount": 2, "widgets": [ {