fix: fix iconslug handling
All checks were successful
Sample Testing / my_job (push) Successful in 2m58s

This commit is contained in:
Marcel S. Henselin 2026-04-17 14:04:01 +02:00
parent 5417352afc
commit f4b486b99b
3 changed files with 15 additions and 9 deletions

13
main.go
View file

@ -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 == "" {