chore: test old
Some checks failed
Sample Testing / my_job (push) Failing after 1m37s

This commit is contained in:
Marcel S. Henselin 2026-04-16 12:21:31 +02:00
parent 557fde5dff
commit 2a8f2dea76
3 changed files with 15 additions and 2 deletions

2
go.mod
View file

@ -6,3 +6,5 @@ require (
github.com/google/go-cmp v0.7.0
github.com/sethvargo/go-githubactions v1.3.2
)
require github.com/google/uuid v1.6.0 // indirect

10
main.go
View file

@ -4,10 +4,12 @@ import (
"bytes"
_ "embed"
"fmt"
"log/slog"
"net/http"
"os"
"text/template"
"github.com/google/uuid"
"github.com/sethvargo/go-githubactions"
)
@ -21,6 +23,7 @@ const (
var message string
type templateData struct {
CardID string
Title string
SubTitle string
Author string
@ -38,6 +41,11 @@ type templateData struct {
func main() {
data := templateData{}
u, err := uuid.NewUUID()
if err != nil {
githubactions.Fatalf("Error generating UUID: %v", err)
}
data.CardID = u.String()
data.Add = ""
author := githubactions.GetInput("author")
@ -107,6 +115,8 @@ func main() {
githubactions.Fatalf("error %s", err.Error())
}
slog.Info("retrieved data", "data", string(jsonStr))
req, err := http.NewRequest("POST", webhook, bytes.NewBuffer(jsonStr))
if err != nil {
panic(err)

View file

@ -1,13 +1,14 @@
{
"cardsV2": [
{
"cardId": "notify-{{ .ActionID }}",
"cardId": "notify-{{ .CardID }}",
"card": {
"header": {
"title": "{{ .Title }}",
"subtitle": "{{ .SubTitle }}",
"imageUrl": "{{ .IconUrl }}",
"imageType": "SQUARE"
"imageType": "SQUARE",
"imageAltText": "message avatar image"
},
"sections": [
{