This commit is contained in:
parent
557fde5dff
commit
2a8f2dea76
3 changed files with 15 additions and 2 deletions
10
main.go
10
main.go
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue